I recently discovered in my Munin report that my RAM usage has been very high since around April 1. I'm not sure of the exact date, but it looks to be the week of the 1st, anyway.
On my end, the only thing that's changed is that I updated PHP to version 5.6.23 on April 9. I also had to modify several scripts to use cURL instead of file_get_contents(), since file_get_contents() is (for some reason) deprecated in 5.6.23.
My server has 4G of RAM, but during peak hours it's trying to use close to 6G, so this is a concern!
I spoke to my server management company, and their only suggestion was that they were seeing a lot of TIME_WAIT connections, with the last IP showing 168 connections:
The IPs all looked local, though, so it's not an issue of an attack or anything; it's apparently a setting, somewhere. But why it only started to have a negative impact on 4/1/17, I don't know.
After doing some research, I modified /etc/sysctl.conf to:
Then in WHM's Apache Configuration I lowered Server Limit from 400 to 256 (Munin showed the highest in the last week was about 120), and Max Clients from 300 to 150.
Then in /etc/my.cnf, I changed max_connections from 300 to 100.
Can you guys suggest anything else I should check... possibly related to the PHP update?
TIA!
On my end, the only thing that's changed is that I updated PHP to version 5.6.23 on April 9. I also had to modify several scripts to use cURL instead of file_get_contents(), since file_get_contents() is (for some reason) deprecated in 5.6.23.
My server has 4G of RAM, but during peak hours it's trying to use close to 6G, so this is a concern!
I spoke to my server management company, and their only suggestion was that they were seeing a lot of TIME_WAIT connections, with the last IP showing 168 connections:
Code:
# The last 5 in the list
xxx.xxx.xxx.xxx is connected 66 in state: TIME_WAIT
xxx.xxx.xxx.xxx is connected 69 in state: TIME_WAIT
xxx.xxx.xxx.xxx is connected 71 in state: TIME_WAIT
xxx.xxx.xxx.xxx is connected 103 in state: TIME_WAIT
xxx.xxx.xxx.xxx is connected 168 in state: TIME_WAIT
After doing some research, I modified /etc/sysctl.conf to:
Code:
# Added these
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_fin_timeout = 25
net.ipv4.tcp_max_orphans = 8192
# Changed from 65536
net.netfilter.nf_conntrack_max = 32768
# Changed from 432000
net.netfilter.nf_conntrack_tcp_timeout_established = 86400
Then in /etc/my.cnf, I changed max_connections from 300 to 100.
Can you guys suggest anything else I should check... possibly related to the PHP update?
TIA!