Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical Scaling of Java real-time application

With GC tuning I am successfully able to get performance for real-time java applications and avoiding recognizable GC pauses. But, this holds good up to ~20 GB of heap space.

Decrease in the hardware cost has made even 100GB of RAM machines affordable. But, still with Java due to GC pauses, higher heap sizes like 50 GB can send you into nightmare at regular times.

I understand that there are options like off-heap and distributed-heap. But, off-heap has a disadvantage of se/derialization and distributed-heap on the hand increases maintenance cost. Further, in distributed-heap you are actually not fully utilizing RAM (say 64 GB) which these days are becoming common as commodity.

Therefore, to fully utilize the potential of RAM, what are the good solutions for vertical scaling of Java applications?

like image 306
sky Avatar asked Jul 16 '13 16:07

sky


People also ask

What is an example of scaling vertically?

Good examples of horizontal scaling are Cassandra, MongoDB, Google Cloud Spanner .. and a good example of vertical scaling is MySQL - Amazon RDS (The cloud version of MySQL). It provides an easy way to scale vertically by switching from small to bigger machines. This process often involves downtime.

Where is vertical scaling used?

Vertical scaling refers to adding more resources (CPU/RAM/DISK) to your server (database or application server is still remains one) as on demand. Vertical Scaling is most commonly used in applications and products of middle-range as well as small and middle-sized companies.

What is vertical scaling in Java?

While horizontal scaling refers to adding additional nodes, vertical scaling describes adding more power to your current machines. For instance, if your server requires more processing power, vertical scaling would mean upgrading the CPUs. You can also vertically scale the memory, storage, or network speed.

How do you scale up a Java application?

Scaling out is usually done with the help of a load balancer. It receives all the incoming requests and then routes them to different servers based on availability. This makes sure that no single server becomes the point of all the traffic and so the workload is distributed uniformly.


1 Answers

I am working on a primitive collections library called Banana. Banana addresses those exact issues. It supports LinkedLists, HashMaps and possibly other data structures soon without the overhead of keeping N objects. basically - the entire storage can be inside an int[] array (or many).

While I did not yet officially released it, most of it is well tested and I have already ran it successfully on servers with 144GB of RAM, maintaining fast and consistent performance without any GC pauses.

Check out this hash-map benchmark to get an idea on how to use Banana to store data and how well it scales vertically.

https://github.com/omry/banana/wiki/Long-to-fixed-size-object-benchmark

See the wiki for more info.

like image 149
Omry Yadan Avatar answered Sep 30 '22 20:09

Omry Yadan