Results of receiving of the same letter with smtp-sink and dbmail-lmtpd

strace -c -f ./smtp-sink -L -d /tmp/pool2/%Y/%m/%d/%H/%M:%S- -u root 0.0.0.0:24 1024
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
63.81    0.446398         218      2046           epoll_wait
 9.79    0.068460          11      6139           time
 8.21    0.057440           9      6390           poll
 7.43    0.052006          37      1392           write
 5.89    0.041224          13      3205           read
 4.59    0.032137          10      3201           gettimeofday
 0.05    0.000338          19        18         1 open
 0.03    0.000224           9        26           old_mmap
 0.03    0.000187           8        23           close
 0.03    0.000178          36         5           mkdir
 0.02    0.000154         154         1           execve
 0.02    0.000151          17         9         5 stat64
 0.01    0.000093           5        18           fcntl64
 0.01    0.000090           5        17           fstat64
 0.01    0.000085          12         7           munmap
 0.01    0.000074           7        10        10 access
 0.01    0.000069          12         6           socket
 0.01    0.000055          14         4         4 connect
 0.01    0.000052          13         4           mmap2
 0.00    0.000029          10         3           epoll_ctl
 0.00    0.000024          24         1           listen
 0.00    0.000020           5         4           _llseek
 0.00    0.000017          17         1           accept
 0.00    0.000015           5         3           brk
 0.00    0.000014           7         2           setsockopt
 0.00    0.000009           9         1           epoll_create
 0.00    0.000009           9         1           bind
 0.00    0.000006           6         1           uname
 0.00    0.000006           6         1           setgroups32
 0.00    0.000005           5         1           setrlimit
 0.00    0.000005           5         1           rt_sigaction
 0.00    0.000005           5         1           getrlimit
 0.00    0.000005           5         1           geteuid32
 0.00    0.000005           5         1           setuid32
 0.00    0.000005           5         1           setgid32
 0.00    0.000005           5         1           set_thread_area
------ ----------- ----------- --------- --------- ----------------
100.00    0.699599                 22546        20 total

strace -c -f ./dbmail-lmtpd -f ../etc/dbmail.conf
Process 3678 attached
Process 3679 attached
Process 3678 detached
Process 3679 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
82.25   73.907258          13   5828219           read
 5.71    5.128893          11    466512           rt_sigaction
 5.19    4.666613          15    311262           gettimeofday
 2.31    2.072720           9    233256           rt_sigprocmask
 2.13    1.916936          12    155486           epoll_ctl
 1.19    1.068105          14     78296           write
 0.68    0.611118           7     90235           _llseek
 0.48    0.430506           6     77751           epoll_wait
 0.01    0.012321         385        32           munmap
 0.01    0.010507         184        57           mremap
 0.01    0.006720          22       310       254 open
 0.01    0.005247           9       593           poll
 0.01    0.004626          75        62         1 close
 0.00    0.003993        3993         1           execve
 0.00    0.001638          10       163       120 stat64
 0.00    0.000983          12        83           old_mmap
 0.00    0.000514          47        11         5 connect
 0.00    0.000404           8        51           fcntl64
 0.00    0.000372          12        32           mmap2
 0.00    0.000332           6        58           fstat64
 0.00    0.000269         269         1           setsid
 0.00    0.000253         127         2           clone
 0.00    0.000232          21        11         5 setsockopt
 0.00    0.000230         230         1           set_thread_area
 0.00    0.000227           8        29        29 access
 0.00    0.000205          21        10           time
 0.00    0.000144          12        12           socket
 0.00    0.000085           9         9           brk
 0.00    0.000070          35         2           unlink
 0.00    0.000067           8         8           send
 0.00    0.000025          25         1           listen
 0.00    0.000023           6         4           futex
 0.00    0.000019          19         1           accept
 0.00    0.000019          19         1           socketpair
 0.00    0.000018           6         3         3 ioctl
 0.00    0.000016          16         1           epoll_create
 0.00    0.000015          15         1           shutdown
 0.00    0.000013          13         1           chdir
 0.00    0.000013           7         2           uname
 0.00    0.000012           6         2           getrlimit
 0.00    0.000011           6         2           getsid
 0.00    0.000011          11         1           bind
 0.00    0.000010          10         1           chmod
 0.00    0.000009           9         1           _sysctl
 0.00    0.000006           6         1           umask
 0.00    0.000005           5         1         1 kill
 0.00    0.000005           5         1           setuid32
 0.00    0.000005           5         1           setgid32
 0.00    0.000004           4         1           set_tid_address
------ ----------- ----------- --------- --------- ----------------
100.00   89.851827               7242582       418 total




Artem Bokhan пишет:
Paul J Stevens пишет:
I looked at the code for smtp-sink.c.

It does the same as dbmail-lmtp: read one char at a time. Only
difference is that it uses getc(2) rather than read(2).
But it looks like it works with 4k blocks. It's 4096 times faster :)

read(5, "AiAC0AIgA/AD8AIgBABC4AIgBfAC0AOw"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "MDEIAAEx\r\nADEAMwA2ABAEMAAwADIAFA"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "ICAgICANAAA4NjAwMjExMTAzMjM5CgAA"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "EwMzI0MQgAADAwMTMyLTE1DQAAODYw\r\n"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "MDcu\r\nMTk4NiAMAAAgMTEuMTAuMTk4Ni"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "AAYDAACYLwAAegMAAAswAADtAwAAmzAA"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "hQUGhvdG9GaXgAQkFTSUMASFBS\r\nUE9G"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "\r\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "AAAAEwEAAA8AAAATAQAAAAAAAAAAAAAA"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "wAAAAAACAAAMCyQCEA6RQB\r\nQQsAfgIK"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "gABgAfAAAa4kA2AIBPAkE2AABM7UAcAA"..., 4096) = 4096
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 0) = 1
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 100000) = 1
read(5, "AAD9AAoAKgACACMADAAAAP0ACgAqAAMA"..., 4096) = 4096




Artem Bokhan wrote:
Paul J Stevens пишет:
If you can think of, or direct me to a better approach for doing async
network reads in lmtp, please do share. I'm sure it's possible. But I
havent really dug into this yet.


Although I'm not sure this can help you, the smallest example of fast
and simple lmtp server it's possible to find with postfix,
/src/smtpstone/smtp-sink.c


NAME
smtp-sink - multi-threaded SMTP/LMTP test server

SYNOPSIS
smtp-sink [options] [inet:][host]:port backlog

smtp-sink [options] unix:pathname backlog

DESCRIPTION
smtp-sink listens on the named host (or address) and port. It takes
SMTP messages from the network and throws them away. The purpose is to
measure client performance, not protocol compliance.

smtp-sink may also be configured to capture each mail delivery transac‐
tion to file. Since disk latencies are large compared to network
delays, this mode of operation can reduce the maximal performance by
several orders of magnitude.

Connections can be accepted on IPv4 or IPv6 endpoints, or on UNIX-
domain sockets. IPv4 and IPv6 are the default. This program is the
complement of the smtp-source(1) program.

Note: this is an unsupported test program. No attempt is made to main‐
tain compatibility between successive versions.

_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail




_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to