Bug #73807 [Com]: Performance problem with processing post request over 2000000 chars

From: Date: Thu, 02 Feb 2017 11:50:38 +0000
Subject: Bug #73807 [Com]: Performance problem with processing post request over 2000000 chars
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207115@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73807&edit=1

 ID:                 73807
 Comment by:         pstef at freebsd dot org
 Reported by:        pparadowski at media4u dot pl
 Summary:            Performance problem with processing post request
                     over 2000000 chars
 Status:             Analyzed
 Type:               Bug
 Package:            Performance problem
 Operating System:   FreeBSD 9.4-11.0
 PHP Version:        5.6.29, 7.0,7.1
 Block user comment: N
 Private report:     N

 New Comment:

This has nothing to do with realloc(). php_std_post_handler() spends 92% in memchr() and 7% in
memmove().


Previous Comments:
------------------------------------------------------------------------
[2017-01-31 10:43:01] nikic@php.net

Another cause might be FreeBSD's *extremely* slow realloc() implementation. I remember this
causing performance issues in other places.

------------------------------------------------------------------------
[2017-01-31 07:12:09] rasmus@php.net

Ok, so it isn't accf_http doing it. It still feels like something along those lines. Like a
socket buffer being too small and the resulting context switching causing it to slow down. Perhaps
try playing around with pmcstat or dtrace and see if you can get a picture of what one of these slow
requests is doing compared to a smaller fast one.

------------------------------------------------------------------------
[2017-01-31 07:00:22] pparadowski at media4u dot pl

While testing accf_http module is disabled

------------------------------------------------------------------------
[2017-01-31 06:53:18] pparadowski at media4u dot pl

my /boot/loader.conf is empty. In defaults loader.conf I've got

accf_data_load="NO"
accf_nds_load="NO"
accf_http_load="NO"

------------------------------------------------------------------------
[2017-01-30 18:20:44] rasmus@php.net

This sounds like an interesting bug. Since it happens on FreeBSD and not on Linux it might be
related to FreeBSD's accf_http "httpready" feature which buffers incoming HTTP
requests before triggering the accept. Could you have a look at your /boot/loader.conf file and try
disabling accf_http_load if it is enabled there and see if that makes a difference? Note that it
triggers a kernel module to be loaded, so you will need to reboot, or manually "kldunload
accf_http"

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=73807


--
Edit this bug report at https://bugs.php.net/bug.php?id=73807&edit=1


Thread (1 message)

  • pstef at freebsd dot org
  • Unknown Message
    • pstef at freebsd dot org
« previous php.bugs (#207115) next »