You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2012/05/16 10:33:09 UTC
[Bug 53239] New: Httpd has problems delivering data on rate-limited
line
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
Priority: P2
Bug ID: 53239
Assignee: bugs@httpd.apache.org
Summary: Httpd has problems delivering data on rate-limited
line
Severity: major
Classification: Unclassified
OS: Linux
Reporter: bjornar.ness@gmail.com
Hardware: PC
Status: NEW
Version: 2.5-HEAD
Component: All
Product: Apache httpd-2
Running httpd in a vm behind a rate-limited (tc, ingress 500kbps, 50kB burst)
line, httpd has problems delivering the data in time. If burst is set to more
than the actual data needed, everything is fine, but when burst is 50kB for
example, and total data is ~150kB, it transfers the first ~50kB quickly, and
then goes in for a huge lag (maby 20 secs) before transferring the rest slowly.
No memory or cpu restrictions. scp/ftp/lighttpd/nginx tested on the same vm
with the same (and much lower) shaping, and works as expected. Response time of
httpd is fine, its the transfer that seems to have a bug in it.
Using event model.
Server version: Apache/2.5.0-dev (Unix)
Server built: May 16 2012 09:35:37
Server's Module Magic Number: 20120211:3
Server loaded: APR 2.0.0-dev
Compiled using: APR 2.0.0-dev
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/apache"
-D SUEXEC_BIN="/opt/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Compiled in modules:
core.c
mod_authn_file.c
mod_authn_dbm.c
mod_authn_anon.c
mod_authn_dbd.c
mod_authn_socache.c
mod_authn_core.c
mod_authz_host.c
mod_authz_groupfile.c
mod_authz_user.c
mod_authz_dbm.c
mod_authz_owner.c
mod_authz_dbd.c
mod_authz_core.c
mod_access_compat.c
mod_auth_basic.c
mod_auth_form.c
mod_auth_digest.c
mod_allowmethods.c
mod_apreq2.c
mod_file_cache.c
mod_cache.c
mod_cache_disk.c
mod_socache_shmcb.c
mod_socache_dbm.c
mod_socache_memcache.c
mod_so.c
mod_watchdog.c
mod_dbd.c
mod_dumpio.c
mod_firehose.c
mod_echo.c
mod_buffer.c
mod_data.c
mod_ratelimit.c
mod_reqtimeout.c
mod_ext_filter.c
mod_request.c
mod_include.c
mod_filter.c
mod_reflector.c
mod_substitute.c
mod_sed.c
mod_charset_lite.c
mod_deflate.c
mod_xml2enc.c
mod_proxy_html.c
http_core.c
mod_mime.c
mod_log_config.c
mod_log_debug.c
mod_log_forensic.c
mod_logio.c
mod_env.c
mod_mime_magic.c
mod_expires.c
mod_headers.c
mod_usertrack.c
mod_unique_id.c
mod_setenvif.c
mod_version.c
mod_remoteip.c
mod_proxy.c
mod_proxy_connect.c
mod_proxy_ftp.c
mod_proxy_http.c
mod_proxy_fcgi.c
mod_proxy_scgi.c
mod_proxy_fdpass.c
mod_proxy_ajp.c
mod_proxy_balancer.c
mod_proxy_express.c
mod_session.c
mod_session_cookie.c
mod_session_dbd.c
mod_slotmem_shm.c
mod_slotmem_plain.c
mod_ssl.c
mod_dialup.c
mod_lbmethod_byrequests.c
mod_lbmethod_bytraffic.c
mod_lbmethod_bybusyness.c
mod_lbmethod_heartbeat.c
event.c
mod_unixd.c
mod_heartbeat.c
mod_heartmonitor.c
mod_dav.c
mod_status.c
mod_autoindex.c
mod_asis.c
mod_info.c
mod_cgid.c
mod_dav_fs.c
mod_dav_lock.c
mod_vhost_alias.c
mod_negotiation.c
mod_dir.c
mod_actions.c
mod_speling.c
mod_userdir.c
mod_alias.c
mod_rewrite.c
Attached strace of downloading a file
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #12 from Bjørnar Ness <bj...@gmail.com> ---
Created attachment 28812
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28812&action=edit
strace -tt -d /opt/lighttpd/sbin/lighttpd
lighttpd running in same vm with same ingress bw limit, but delivering data as
should be expected. ingress limit 200kbps/20KB burst
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #7 from Joe Orton <jo...@redhat.com> ---
$ grep 'pid 438.*08:14:49' logfile | sed 's/writev(6, .*) = /writev(6, ....)
= /'
...
[pid 438] 08:14:49.102908 writev(6, ....) = 14480
[pid 438] 08:14:49.103150 writev(6, ....) = -1 EAGAIN (Resource temporarily
unavailable)
[pid 438] 08:14:49.103347 writev(6, ....) = 20272
[pid 438] 08:14:49.103578 writev(6, ....) = -1 EAGAIN (Resource temporarily
unavailable)
[pid 438] 08:14:49.103775 poll([{fd=6, events=POLLOUT}], 1, 60000) = 1
([{fd=6, revents=POLLOUT}])
[pid 438] 08:14:49.103837 writev(6, ....) = 14480
That second writev() call failed with EAGAIN - why did httpd immediately retry
it without first doing a poll()? That looks weird and wrong.
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #13 from Bjørnar Ness <bj...@gmail.com> ---
Has anyone looked into this? Using 2.4.2 now, and still seeing
the problem, here is how you can reproduce:
tc qdisc add dev eth0 root handle 1:
tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:1 htb rate 10mbps burst 15k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 100kbps burst 10k
... now this works fine here (100kbps)..
øets try 200kbps
tc class replace dev eth0 parent 1:1 classid 1:10 htb rate 200kbps burst 10k
... try downloading some file from apache... completely hangs
what is going on here? Eventually try other speeds.
Lighttpd handles the exact same settings just fine, so I dont want to believe
this is not a httpd bug!
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #1 from Bjørnar Ness <bj...@gmail.com> ---
Created attachment 28785
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28785&action=edit
strace -tt -d httpd -X
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #10 from Bjørnar Ness <bj...@gmail.com> ---
Created attachment 28808
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28808&action=edit
strace -tt -d /opt/apache/bin/httpd -X > logfile 2>&1
Server version: Apache/2.5.0-dev (Unix)
Server built: May 21 2012 12:27:51
Server's Module Magic Number: 20120211:3
Server loaded: APR 2.0.0-dev
Compiled using: APR 2.0.0-dev
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/opt/apache"
-D SUEXEC_BIN="/opt/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Compiled in modules:
core.c
mod_authn_file.c
mod_authn_dbm.c
mod_authn_core.c
mod_authz_host.c
mod_authz_user.c
mod_authz_core.c
mod_access_compat.c
mod_auth_basic.c
mod_apreq2.c
mod_request.c
http_core.c
mod_mime.c
mod_log_config.c
mod_logio.c
mod_env.c
mod_headers.c
mod_setenvif.c
mod_proxy.c
mod_proxy_fcgi.c
prefork.c
mod_unixd.c
mod_vhost_alias.c
mod_dir.c
mod_rewrite.c
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #8 from Joe Orton <jo...@redhat.com> ---
Can you reproduce this if using prefork rather than event?
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #4 from Stefan Fritsch <sf...@sfritsch.de> ---
I don't think this is httpd's fault. The strace shows that at 08:14:49.102908,
httpd starts to send data. The socket buffer gets full a few times, httpd uses
poll() to wait each time and sends more data. This works as expected until
08:14:49.105963 when httpd has sent about 75k of data. There, the socket buffer
is full again but the poll() returns only 25 seconds later, at 08:15:15.686502.
This means either there was no data going through the network and the buffer
was really not writable for these 25 seconds, or there is a kernel bug.
Of course, it is rather strange that Apache httpd triggers this problem but it
seems lighttpd doesn't. Accordingly, I have no idea what we could do to avoid
the problem. If the kernel tells us we can't write to the socket, there is
nothing we can do about that.
You could try analyzing the network traffic with wireshark and see if there are
lost packets.
NB: There seems to be an unrelated bug somewhere because the mmap() of the read
file is done at unaligned offsets, which fails and makes httpd fall back to
writev(). I don't see this here on my system. This could be due to you using
apr 2.0 which is unreleased and not stable. I would recommend to use the newest
released versions of apr and apr-util instead (1.4.x).
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #5 from Bjørnar Ness <bj...@gmail.com> ---
Created attachment 28800
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28800&action=edit
pcap of transfer (not same as above)
Ingress limited to 200kbps with 20Kb burst
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #3 from Bjørnar Ness <bj...@gmail.com> ---
Created attachment 28787
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28787&action=edit
har-log of site loading in lighttpd
Use:
http://pcapperf.appspot.com/
to view har
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
Bjørnar Ness <bj...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bjornar.ness@gmail.com
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #9 from Bjørnar Ness <bj...@gmail.com> ---
I reproduced with worker atleast, should I also try with prefork -X ?
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #11 from Bjørnar Ness <bj...@gmail.com> ---
First download is firefox, second wget
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #6 from Bjørnar Ness <bj...@gmail.com> ---
Tried with sendfile disabled (ref:
https://issues.apache.org/bugzilla/show_bug.cgi?id=53253)
No change. Pcap is apache running as worker with sendfile off
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 53239] Httpd has problems delivering data on rate-limited line
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53239
--- Comment #2 from Bjørnar Ness <bj...@gmail.com> ---
Created attachment 28786
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28786&action=edit
har-log of site loading in httpd 2.5-trunk
Use:
http://pcapperf.appspot.com/
to view har
--
You are receiving this mail because:
You are the assignee for the bug.