title: WordPress website with high Ram usage (on a VPS server) is crashing
body: <p>I operate this WordPress website - menstrualcupreviews(dot)net, it is on a VPS server with 2GB RAM and 2 core-CPU. I noticed I got many connections from the server to itself and also from the active users. </p>
  
  <p>My guess was something with the sidebar of the website - it is manually included from each page\post with full path (include "http://...."), and the file also includes few other files in the same way (full path with http).</p>
  
  <p>In some point when we got only 20-30 online visitors, It had 1800+ self connections (on a 2GB RAM) from the server IP to itself and it caused the server to crash.</p>
  
  <p>I have changed it to be relative path (without the "http://"), and the number of self connections dropped from 1800+ to about 50-60 self connections, and also upgraded the RAM to be 8GB.</p>
  
  <p>Now, we currently get around 100-200 online visitors and I get
  Mem:   8059424k total,  6759236k used, which is not far from crashing again.
  The 8GB RAM memory and CPU are on such a high load and I am sure the website need to be optimized.</p>
  
  <p><strong>For example in a given moment with about 150 visitors:</strong></p>
  
  <p>ss -tuna | awk '{print $6}' | cut -d : -f1 | sort | uniq -c | sort -nr | head</p>
  
  <ul>
  <li>108 198.1.72.1 (==>The SERVER IP - 108 self connections!!!)</li>
  <li>51 186.237.5.188</li>
  <li>31 *</li>
  <li>20 177.216.202.135</li>
  <li>15 168.90.64.203</li>
  <li>14 201.37.162.119</li>
  <li>14 177.182.1.136</li>
  <li>13</li>
  <li>12 191.251.41.105</li>
  <li>12 186.212.162.110</li>
  </ul>
  
  <p>I am not sure what causing those self connections OR many connections from random IP's I guess are some visitors.</p>
  
  <p>Any ideas how to solve the high load and if those connections are the reason?</p>
  
  <p>Thanks in advance! (-:</p>