Elgg Website Optimization

My website URL : https://safalaya.com . I am using elgg - 1.8.19 . Previously I was using Shared Hosting . Recently I upgraded to VPS Hosting as suggested by my web host due to increase in traffic . I am now facing Memory Loading Issue . Due to this my website is automatically shutting down , restarting and getting slow . How can I optimize my website so that my website should permanently work properly .  The details of log provided by my webhost are :

As per the logs on April 24th 2018, the server had run out of memory(RAM):
[Tue Apr 24 19:01:41 2018] [error] [client 80.252.171.75] Script timed out before returning headers: index.php
[Tue Apr 24 19:02:31 2018] [error] [client 216.218.222.14] Script timed out before returning headers: index.php, referer: http://marian.web.telrock.net
[Tue Apr 24 19:02:32 2018] [error] [client 80.252.171.71] Script timed out before returning headers: page_handler.php
[Tue Apr 24 19:02:32 2018] [error] [client 195.201.115.213] Script timed out before returning headers: index.php, referer: http://safalaya.com/groups/profile/384579/profile/CCobbs/
[Tue Apr 24 19:02:35 2018] [error] [client 212.227.221.35] (70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed
[Tue Apr 24 19:01:59 2018] [error] [client 194.187.170.132] Script timed out before returning headers: index.php
[Tue Apr 24 19:02:37 2018] [error] [client 107.178.193.58] Script timed out before returning headers: index.php
[Tue Apr 24 19:02:38 2018] [error] [client 45.125.14.21] Script timed out before returning headers: page_handler.php, referer: http://safalaya.com/
[Tue Apr 24 19:02:38 2018] [error] [client 34.207.172.99] Script timed out before returning headers: index.php, referer: https://www.google.com/
[Tue Apr 24 19:02:56 2018] [error] [client 95.110.224.30] Script timed out before returning headers: page_handler.php, referer: http://safalaya.com/
[Tue Apr 24 19:01:35 2018] [error] [client 118.171.218.52] Script timed out before returning headers: page_handler.php, referer: http://safalaya.com/
[Tue Apr 24 19:03:00 2018] [error] [client 95.110.224.30] Script timed out before returning headers: page_handler.php, referer: http://safalaya.com/
[Tue Apr 24 19:03:05 2018] [error] [client 45.56.107.90] Script timed out before returning headers: index.php
[Tue Apr 24 19:03:06 2018] [error] [client 212.83.133.63] Script timed out before returning headers: index.php
[Tue Apr 24 19:03:07 2018] [error] [client 103.105.86.52] Script timed out before returning headers: index.php, referer: http://safalaya.com/
[Tue Apr 24 19:03:10 2018] [error] [client 196.223.128.40] Script timed out before returning headers: page_handler.php, referer: http://safalaya.com/
[Tue Apr 24 19:03:12 2018] [error] [client 45.79.156.14] Script timed out before returning headers: index.php
[Tue Apr 24 19:03:14 2018] [error] [client 45.33.78.108] Script timed out before returning headers: index.php
[Tue Apr 24 19:02:48 2018] [error] [client 195.201.93.124] Script timed out before returning headers: page_handler.php, referer: http://safalaya.com/
  • Without knowing what requires all the memory it's IMPOSSIBLE to give you any advice how you might be able to improve your server configuration.

    You already posted the same question no long ago and I already gave you some hints what you could try to find out what might be wrong. Have you tried any of my suggestions at all? If you ask the same question again and again without trying for yourself what has been suggested you won't get it any improvements ever. It's simply not possible to give you this one advice that will fix the problem for sure because there could be many reasons for the out-of-memory issue (plugin requires too much memory or at least more than memory_limit in .htaccess, keeping connections of mysql alive with a too hight maximum number of connections or some bad settings in mysql configuration not suitable for the amount of ram of your server etc. etc.).

    You need to monitor your server and test out memory consumption at least for a few hours or days to find out when the memory consumption gets critical.

    Or hire someone with good knowledge of server administration or administrating Elgg sites (or knowledge about both) to help you with improving your server configuration. For example, you could ask for (paid) help here in the Professional services group and you might get contacted with someone who takes such jobs. Even if it will cost you it might be your only chance to get it fixed if you are not ready to learn more about server administration on your own (something you can't do in just a few hours or days for sure!).