0

I'm relatively new to solr. I have a production site running on a VPS, but now I'm having serious load issues. I don't know where to start in order to get the load down...

VPS specs (linode.com 512)

  • 512 MB RAM
  • 4 CPU (1x priority)

Looks like my solr server (tomcat) is using a lot of CPU power

enter image description here

You can find my solrconfig.xml on http://pastebin.com/qdfi8Med and my schema.xml on http://pastebin.com/rRusDP8b

I've tried to increaese the cache size, but this didn't do anything on the load. You can see the stats page below.

EDIT - Because the screenshot was unclear, I took smaller screenshots if what (I think) is important.

Dismax query handler stats

Dismax query handler stats

Caches stats enter image description here

enter image description here

enter image description here

Thanks for the help!

Ward Loockx
  • 205
  • 1
  • 3
  • 11

2 Answers2

1

In my experience Solr is quite resource-intensive. According to your screencaps, you are trying to handle 21 requests per second on a server with 512MB of RAM. Very simply, you might need to just throw more hardware at this problem to get it under control.

BenGC
  • 1,775
  • 15
  • 26
  • Isn't it possible to tweak it a bit? I try to get the maximum out of my hardware. I hope there are ways to optimise this. – Ward Loockx Dec 18 '12 at 17:01
  • I adjusted JAVA_OPTS="-Xmx420M -Djava.util.logging.config.file=/var/lib/tomcat6/solr/logging.properties", maybe this can be tweaked? Or some things in solrConfig/Caches? – Ward Loockx Dec 18 '12 at 17:03
0

First, 512MB is just a bit too little to run Solr 3.6 with Tomcat, Solr 4.0 may crash. I Used to run Solr 4.0 on EC2 micro, it has 613 MB ram. it was not enough to run a small Solr site (5-10 req/s)

To Run Solr safely, you will need the 1GB linode. But I do recommend a 2GB machine to run SOLR smoothly.

On my 1.6GB SMall EC2 Server, I set SOLR max memory to 1.2GB, and leave the remaining 400MB for OS caching and other small services like monit, munin, ssh, apt-get, rsync, backups, etc.

this is my JAVA_OPTS that I set on my .bashrc file:

export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/"
export SOLR_HOME="/mnt/Solr/Home"
export CATALINA_HOME="/mnt/Tomcat/Home"
export LOGGING_CONFIG="-Djava.util.logging.config.file=/dev/null"
unset JAVA_OPTS
export JAVA_OPTS="$JAVA_OPTS -Xms1200m -Xmx1200m -server -d64 -XX:MaxPermSize=200m"
export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/mnt/Solr/Home"

Amazon EC2 CPU is very low compared to Linode, but I have great performance with it since Solr uses almost no CPU but a lot of ram... you could go with EC2 medium for a large Solr Server.

PS. Also I noticed your Screenshot that you have the kswapd0 process that recorded a lot of CPU IO time. I have that issue with linode and it was because of an outdated kernel. you should reboot your maching with a newer kernel.

Fred
  • 151
  • 1
  • If you insist on running solr on a 512MB machine try these settings: -Xms200m -Xmx360m -server -d64 -XX:MaxPermSize=80m – Fred Jan 08 '13 at 15:58