在高性能服务器上缓慢Apache响应时间

My server enviroment: CENTOS 6.5 x86_64, apache 2.2.27 with prefork module with PHP 5.2.17 (cli). and this server for 1 streaming video site (like youtube) and i have problem with Apache response time and i think the problem with httpd.conf file. so anybody can help me to config Apache?

SERVER SPECS:

  • Intel Xeon 2x E5-2650v2
  • Cores/threads: 16c/32t
  • Frequency/burst: 2,6 GHz+/3,4 GHz+
  • RAM: 128 GB DDR3 ECC 1600MHz
  • Hard disks: 3 x 2 TB SATA3 6 Gbps with Hardware RAID 5 (MegaRAID LSI 9271-4i CacheVault 1 GB)
  • Guaranteed bandwidth: 500 Mbps

currently apache configured as follows:

  • Start Servers 5
  • Minimum Spare Servers 5
  • Maximum Spare Serves 10
  • Server Limit 8192
  • Max clients 4800
  • Max Requests per Child 10000
  • Keep-Alive Timeout 5
  • Max Keep Alive requests 100 default
  • Timeout 300 default

I use a suphp PHP 5 Handler and Apache suEXEC is On.

the website receives about 40-60k visitors daily (120-180k Impressions/day)

Apache response time becomes slow when Online users becomes more than 200,

Thanks in advance :)

Maybe your website slows down because of a database limitation? If you say with 200 users, it looks like a default limit of MyŚQL.

Are you sure it is related to apache?

If you somewhere not close the connections in a good way, it can run out of connections

I suggest you to use below tools to fine tune your server

Apache:

https://github.com/richardforth/apache2buddy

Mysql:

https://github.com/major/MySQLTuner-perl

Furthermore I sugegest you to offload your static contents to cdn (images.js.css), as they might be eating your webserver. Use gzip compression and do static assets caching as well. Perform a scan of your site on below tools to see response time for requests.

webpagetest
gtmetrix