I am writing a project in PHP using node.js. CMS is completely your own. I reduced the number of database requests through memcache. May increase to 26 requests. Very worried about the load on the server. How normal are these indicators?

Execution time: 0.00146 S Memory usage: 365.3 KB Database queries count: 9 
  • one
    In vain you worry, synthetically you have about 600 rps, which is a very good indicator (I don’t imagine a car on which the same wordpress will be able to issue at least a hundred). I would be worried about "CMS completely my own" and "PHP using node.js", because these are warning flags about incorrect turns. - etki 4:56 pm
  • Thank. The site now lies on the cheapest vps from fasstve. Node.js runs cleanly here, no output is expected, so everything is fine. Regarding "Fully own CMS" - the code refactor regularly :) - Alexey
  • Is memory consumption at half a megabyte normal? - Alexey
  • More than that, it's a penny - etki

1 answer 1

Still decided to answer a little more.

The key parameter of a web application that is responsible for performance is RPS, Requests Per Second, the number of requests per second that the application processes (and, as you know, RPS forms both the application code itself and the database, server, and network bandwidth ). From a single measurement it can not be taken out in any way, the only thing that can be imagined is that the requests go sequentially one by one and take the above described time. In this case, we get RPS = 1s / 0.00146s = 685 requests per second. The real RPS will not be equal to this number, and will always depend on the equipment (the real RPS can be both smaller and more calculated depending on how well the multithreading is implemented in the whole query processing algorithm and how much some queries can slow down others due to shared resources), but the number itself is very good (although, I suspect, you do not have a special load inside). It should also be said that it is considered good form to give the user a page within 200ms or 0.2s - this condition is also satisfied even with the cost of plus or minus 100ms for the network.

It’s also not worth worrying about the database, as long as your records are in the thousands. Optimizing communication with her is always a plus, but the fear of the influence of the database on the rate of fire is usually higher than what is really expected. Joins, as a rule, are represented by joins on large tables and samples on non-indexed fields, but this zoo usually only makes itself felt on large applications. As long as you have less than a conditional thousand entries, the difference in speed will most likely be within the bounds of the error. Once again, it is always right to optimize the database and cache the answers, but often this is a completely non-priority branch of development, and it is very easy to shoot a leg with caching.

Last remark - about samopisny CMS and node. There is such a general rule - hardware is cheap, developers are not - even the most serious server per month is cheaper than the programmer. While you are being sprayed into different languages, you (most likely) spend more resources (and not necessarily right now - finding a replacement specialist becomes more difficult), rather than everything was done on one technology stack. Similarly, about frameworks - they should not be neglected, because even the rate of fire will be compensated by well-established interfaces, basic codebase support and confidence in its futility, ready-made expansion solutions and many ready-made solutions that are needed now (the same query caching, for example ).

  • Thank you so much for the detailed answer. Most things knew some not. I do not like frameworks because I saw how they are used by the majority. For example, we take, we buy template Joomla, on the template. And we see 15 frameworks in one template that give a page in 30 seconds. I try to write a CMS that will be very productive, understandable and flexible for me. It is already used in my 3 projects, I think it is good. In general, if PHP does not die, then my CMS will not die. - Alexey
  • Joomla and plugins are not related to frameworks - etki
  • Everything is absolutely true in the answer. I will add only what writing on the framework is to have a kind of standard in the project that other developers will know, and they, as you know, constantly come and go, but the project remains. And, yes, Joomla, like other systems for content managers, have nothing to do with frameworks, and I would even say about programming as a whole) - Alliswell