how many times can you spot the letter "4" in:
q: latency (wait ttfb) on ec2 my application is crawling a website. i use this crawler :


*

*https://github.com/rfussien/leboncoin-crawler
on my dev environment, the latency is acceptable (3-4 sec) but on my prod server (ec2 t2.micro linux/amazon) there is a 30 seconde latency (wait ttfb).
i tested the same code in another server (1&1) and there is a acceptable latency (3-4 sec). so the problem is not inside the code, but about the server config.
i have tried :


*

*check the php conf (php.ini)

*add cache to php (zend opcache)

*add apache 2 vary: accept-encoding header

*test a t2.medium instance 

*change the region of my instance


i found this similar question :
php + apache long wait time but i think that my ec2 volume is an ebs ssd so there is no access time issue.
this unsolved question is also link to mine : https://stackoverflow.com/questions/34299038/deployed-web-application-long-ajax-wait-ttfb-time
an extract of vmstat during the request:
[ec2-user@ip-xxx-xx-xx-xx ~]$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0   1580 534472  29696 240356    0    0     2    31   14   41  0  0 100  0  0   
 0  0   1580 534456  29696 240356    0    0     0     0   19   43  0  0 100  0  0   
 0  0   1580 534456  29696 240356    0    0     0     0   12   37  0  0 100  0  0   
 0  0   1580 534456  29696 240356    0    0     0     0   12   38  0  0 100  0  0   
 0  0   1580 534456  29696 240356    0    0     0     0   15   45  0  0 100  0  0   
 0  0   1580 534456  29696 240356    0    0     0     0   18   49  0  0 100  0  0   
 0  0   1580 534456  29696 240356    0    0     0     0   12   38  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   32   60  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   13   39  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   17   45  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     4   16   49  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   13   40  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   13   38  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   13   38  0  0 100  0  0   
 0  0   1580 533544  29696 240356    0    0     0     0   16   47  0  0 100  0  0   
 0  0   1580 533544  29700 240352    0    0     0     4   17   48  0  0 99  1  0    
 0  0   1580 533544  29700 240356    0    0     0     0   15   39  0  0 100  0  0   
 0  0   1580 533544  29700 240356    0    0     0     0   13   39  0  0 100  0  0   
 0  0   1580 533544  29700 240356    0    0     0     0   13   39  0  0 100  0  0   
 0  0   1580 533544  29700 240356    0    0     0     0   17   46  0  0 100  0  0   
 0  0   1580 533544  29700 240356    0    0     0     4   19   50  0  0 100  0  0   
 0  0   1580 533544  29700 240356    0    0     0     0   15   41  0  0 100  0  0

[update]
right now i know that this latence is due to a guzzlehttp\client request :  
(string) $this->httpclient->get($url)->getbody();

my security group seems ok, all is allowed from outbound and http is allowed from inbound. my network out also seems ok (40,000 - 50,000 bytes when i request).
i'm thinking that this should be a problem with mpm_prefork_module...
[update 2]
from ssh, if i curl http://google.fr, i have no latency. if i curl my specific url (http://www.leboncoin.fr) the latency is >30 sec. it's specific to my aws ec2 with this url. 

user
In that passage, there are 85 occurrences of the letter "4."
assistant