What I have:

A server on Ubuntu 16.04 with some iron features, tomcat8 and projects running on it. There is one project that receives requests from outside, and on this, basically, its work is built. Up to several tens of thousands of requests per evening come to the peak load (at the moment), which is on average up to 5 requests per second. With such a load, the server starts to blunt - all other projects are also not responding. I myself make any request for any of the projects, and I get connection timed out .

What I need:

stable work and low demands on the gland.

There was (before the forced improvement) approximately the following server configuration: Intel Xeon 2,4 ГГц single core, 1GB RAM , the rest is not so important. If you disable tomcat, free RAM was up to 900 megabytes, with even a small load and tomcat enabled - no more than 100 megabytes. Quite a bit too much, he eats, even though maybe my code is not very well optimized.

Question:

What technology is better to use, what is better to switch to, so that a too powerful server is not needed, and not to worry that with a slight increase in load, something can fall again.

python , node.js , some java , php , etc frameworks? The essence, in principle, is to transfer only one project to another platform, and return to a weaker and cheaper server. I would be glad if you tell me what, perhaps, is the problem of such high demands of the project / project, and what is the best way to go. Heard that node.js is pretty fast, and, sort of like, the fastest for the backend. But I'm not sure, and I would like to hear some "expert opinion".

If someone wants to say that "the question is too general," and so on and so forth. Extremely briefly specifying: is the Tomcate bad bad, or maybe the reason is different?

With what technology is it best to write applications on the backend at the moment, in terms of performance and hardware requirements?

I would be extremely grateful for the answer.

  • Obviously, an assembler. Just before running to another solution (even an assembler, even a python, even a node), you should first thoroughly understand the causes of the problems, otherwise on another solution you risk getting the same problems. - andreymal
  • @andreymal, I don’t definitely sit down for the asm :) Frankly, I don’t know how to find out the problems: I didn’t see errors about the lack of RAM, I didn’t see any errors at all - just the waiting time is exceeded. - Peter Samokhin
  • Debagger in hand and see how your code is executed, line by line (though I do not know how it is done in Tomcote) - andreymal
  • @andreymal unfortunately, debugging is not so easy to perform, and in what conditions to conduct it? Simulate a large load and lift locally? Not very clear. And, in fact, everything is out of the box - I picked up the volume, created the servlet, signing one annotation and redefining one method. The lines of business logic code are not so long, so I also reject the code optimization: the server stops responding completely, and this happens only when there are a large number of requests to my server. That's what you need to figure out. - Peter Samokhin
  • Short lines are usually slower than long ones, and everything else as you described: imitate workload, look at business logic, suffer, suffer, this is all) I searched for a memory leak in a python project so recently, I found it in three months) - andreymal

0