2

I have a Struts 1.3 Application running in JBOSS AS 5.1. We have set 2000 HTTP Threads in the server.xml file for the HTTP Connector and allocated approx 2GB of RAM in the JVM heap to JBOSS in the run.conf file. The system has a total of 4GB RAM and the remaining RAM is in use by other applications.

Whenever my system is hit with over 2000 concurrent requests, Jboss just hangs and stops working. I don't get exceptions on the console or out of memory errors of any sort, it just hangs.

How do I resolve this? Should I put mod_cluster or something in front of JBOSS? Or should I just allocate more threads to the connector, if so how do I figure out what ratio to use between memory and maxThreads on the HTTP connector?

1 Answer 1

5

2000 is a very high number. If you truly need it to handle 2000 concurrent requests, you will need to setup multiple instances and distribute the load evenly across the instances. You can setup a load balancer or apache+mod_jk in front of jboss.

How much memory to use will depend on the application. How many instances to use will depend on how well the instances perform under load and whether you can get the required response time.

12
  • Do you mean setup multiple instances on the same system? If so why would that be beneficial over a single instance of JBOSS running? This is an enterprise web app so handling 2000+ users is something we need. Also could you recommend some tool that I could use to figure out how much memory each component of my application is using? Commented Mar 14, 2012 at 9:50
  • @user1266369 You don't need 2000 connector threads to handle 2000 users. Unless the application makes very heavy network use, 200 is probably more realistic. For greater throughput, more RAM / heap space will help and there are numerous ways to tune the connector for better performance.
    – Michael
    Commented Mar 14, 2012 at 10:52
  • If its an enterprise web app, you dont want one instance serving all the users. What happens when that single instance goes down ? Failover is definitely one reason to setup multiple instances. Also, if the cpu usage on that one servers grows, you can always stand up another server and move the second instance to that server.
    – souser
    Commented Mar 14, 2012 at 16:11
  • The tools I have used for analyze memory usage for Sun JDK are verbosegc log files, jconsole and sometimes visualvm. But I dont think they provide the details you have requested.
    – souser
    Commented Mar 14, 2012 at 16:15
  • @Mikaveli As far as I know every new URL hit for my web app that hits my JBOSS service will be handled in a new HTTP connector thread until a previous thread is released. If there is a lot of concurrent traffic on the web app this forces the system to use more threads from the connector as far as my understanding goes. How are you making 200 threads work for 2000 users in this case? Commented Mar 15, 2012 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.