-1

We have a few servers on Google Cloud Platform. I enabled Google stackdriver and it looks like our Solr servers are consistently at 70%+ memory utilization. We can increase the memory if it is likely to speed up queries (our Solr queries are taking a few hundred milliseconds). I tried free and ps (pagefault ) commands and here is the output.

free -h -c 5 -s2
              total        used        free      shared       buff/cache   available
Mem:           7.1G        4.7G        134M         37M        2.3G        2.2G
Swap:            9G        2.5G        7.5G

Output from ps, only first line which is for the Solr process.

ps -eo min_flt,maj_flt,cmd | sort -nr
623846089 4526790 java -server

Will increasing memory help?

Jayadevan
  • 148
  • 8
  • Generally increasing a cloud VM size is quick and easy. You could try increasing the VM memory and see what happens to your query time. – Tim Sep 21 '19 at 05:02

1 Answers1

4

Your servers are over 100% memory utilized. You are using 2.5 GB of swap space. Yes, you need more memory. At least 2.5 GB more. Never starve your systems for memory. My cell phone has more memory than your server.

John Hanley
  • 4,287
  • 1
  • 9
  • 20
  • Generally agree and do agree for this workload, however some workloads can hope with limited RAM. I have a basic LEMP server, t3a.nano, running Nginx, MySQL, PHP. 512MB RAM, 512MB swap with 100MB swap used, it works great on my lightly loaded server. – Tim Sep 21 '19 at 09:13
  • @Tim - your server configuration will fall down like a house of cards under any form of stress. For the T-micro style instances, the extra workload swapping to disk will cause these tiny systems to thrash very quickly. – John Hanley Sep 21 '19 at 14:34
  • Yes, you're right, it could, and you've given great general advice! But I have mitigations. MySQL is tuned to reduce RAM. PHP has only 2 or 3 threads available, that's the main CPU consumer. The content is almost static and is cached in Nginx, which uses almost no CPU to serve pages. CloudFlare caches pages (non-standard configuration) and protects against DDOS. All this prevents the server going down, it will just go slowly. I could easily automate scaling the server up / out if it was important it stay up, but it's not critical, and in 5 years it hasn't happened so I haven't bothered :) – Tim Sep 21 '19 at 18:25
  • While I totally agree with your advice, my point is just that general rules have exceptions :) – Tim Sep 21 '19 at 18:25
  • @Tim - you should write an article about your configuration. There are skills to be acquired from your experience. – John Hanley Sep 21 '19 at 18:50
  • I wrote a tutorial about it, it's [here](https://www.photographerstechsupport.com/tutorials/hosting-wordpress-on-aws-tutorial-pt1-introduction-configuration-downloads/). – Tim Sep 21 '19 at 19:22
  • @Tim - Thank you for the link. I will read your article. – John Hanley Sep 21 '19 at 19:31