Skip to content
Advertisement

handling vps numproc limits

this is my vps package £14.99 uk pounds a month, so not to expensive.

Thay are limiting numproc to 96, they didn’t make it obvious that this was a limit when I signed up, but I suppose it is my fault for not asking.

I am running Tomcat and if I run out of numproc then Java will crash and the container will need a manual restarting.

So I have added the following to server.xml to limit the number of threads. Experimentation has led me to the number 20 as a stable maximum.

<Connector port="80" protocol="HTTP/1.1"
           maxThreads="20" 
           connectionTimeout="20000"
           redirectPort="8443" />

I am thinking that using maxThreads=”20″ will prevent more than 20 servlet requests from running simultaneously, Please correct me if this is not the case.

I think that numproc the maximum number of all threads? If so then I sometimes have almost 76 other threads running, seems like a lot but there is Java, Tomcat, Hibernate, Ehcash, FTP, SSH, MYSQL and 2 instances of JavaMelody

Anyway my question is.

Is setting maxThreads=”20″ the best way to keep the the numproc down, Or is there a better way. Finally is my vps being unfair with a limit of 96?

By the way I am a long long way away from hitting any other system limits.

Advertisement

Answer

Finally is my vps being unfair with a limit of 96?

Absolutely not. For £14.99 uk pounds a month you can’t expect huge amounts of processor resources. Besides, 20 simultaneous servlet requests is quite a lot …

… they didn’t make it obvious that this was a limit when I signed up …

Yea. Its called “fine print”. But if you don’t read the “fine print” in the contract then you can’t really complain.

(I can’t identify the package / offering you were using, but the numprocs limitations are documented on the website; e.g. http://help.1and1.co.uk/servers-c40665/virtual-server-c63188/virtuozzo-power-panel-c63246/extended-resources-of-a-1and1-virtual-server-a686172.html)

Look, if you can’t live with this, either:

  • look for a better provider, or
  • upgrade to a better (more expensive) package.

You could try complaining or pleading that yours is a special case, but I doubt it will achieve anything. You should have read that fine print.


Is setting maxThreads=”20″ the best way to keep the the numproc down.

That only addresses the size of the servlet request threadpool. What about the MySQL worker threads? The number of MySQL connections? The number of simultaneous requests for your FTP service? Do you need 2 instances of JavaMelody? Etcetera.

One thing you could do is to take a Java thread dump to see what other threads exist in your JVM(s). Maybe something you’ve not considered is eating into your numprocs ration.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement