Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Web Application for 5000~ Users

For the first time (hopefully not the last) in my life I will be developing an application that will have to handle a high number of users (around 5000) and manage lots of data. I have developed an application that manages lots of data (around 100~ GB of data, not so much by many of your standards), but the user count was pretty low (around 50).

Here is the list of tools / frameworks I think I will be using:

  • Vaadin UI framework
  • Hibernate
  • PostgreSQL
  • Apache Tomcat
  • Memcached (for session handling)

The application will mainly be run inside a company network. It might be run on a cluster of servers or not, depends on how much money the company wants to spend to make its life easier.

So what do you think of my choices and what should I take caution of?

Cheers

like image 845
Flakron Bytyqi Avatar asked Mar 13 '12 12:03

Flakron Bytyqi


1 Answers

The answer, as with all performance/scaling related issues is: it depends.

There is nothing in your frameworks of choice that would lead me to think it wouldn't be able to handle a large amount of users. But without knowing what exactly you want to do or what your budget is, it's impossible to pick a technology.

To ensure that your application will scale/perform, I would consider the following:

  • Keep the memory footprint of each session low. For example, caching stuff in the HttpSession may work when you have 50, but not a good idea when you have 5000 sessions.
  • Do as much work as you can in the database to reduce the amount of data that is being moved around (e.g. when looking at tables with lots of rows, ensure that you've got paging that is done in the database (rather than getting 10,000 rows back to Tomcat and then picking the first 10...)
  • Try to minimise the state that has to be kept inside the HttpSession, this makes it easier to cluster.

Probably the most important recommendations:

  • Use load testing tools to simulate your peak load and beyond and test. JMeter is the tool I use for performance/load-testing.

When load testing, ensure:

  • That you actually use 5000 users (so that 5000 HttpSessions are created) and use a wide range of data (to avoid always hitting the cache).

EDIT:

I don't think 5000 users is not that much and you may find that (performance-wise) you only need a single server (depends on the size of the server and the results of the load testing, of course, and you may consider a clustered solution for failovers anyway...) for handling the load (i.e. not every one of your 5000 users will be hitting a button concurrently, you'll find the load going up in the morning (i.e. everyone logs in).

like image 167
beny23 Avatar answered Oct 02 '22 21:10

beny23