Bug #4497
closedRudder web UI freezes when too many inventory are received at the same time
Description
When testing the scalability of Rudder in the number of nodes axis, we demonstrated that the endpoint (the war in charge of parsing and saving inventories) may consume the whole memory allocated to Jetty web server, and so deeply impact the usability of Rudder UI (the second war), leading to moustrous response time, or even the complete stale of the web UI.
The reason is that the endpoint application processing of an incoming inventory is splitted in 3 parts:
- 1/ handling of the HTTP request. That part is responsible of validating that we have a correct HTTP request (Post, good url, posted document available, etc)
- 2/ checking that the posted document is actually an XML file that we can parse as a Fusion Inventory report, and which contains the requiered tags for Rudder (UUID, etc)
- 3/ actually saving the report in the correct status in our LDAP database (checking if it is already present, updating what needs to be, etc).
The part 1/ is handled by jetty, nothing much to say about it.
The part 2/ and 3/ are asynchrone, so that at the end of part 2/, we are already able to answer to the HTTP request ("ok, I'm processing your inventory" or "failed precondition" or other error status). So we have a queue used to communicate between step 2/ and 3/.
The problem is that 2/ is much quicker than 3/. So, parsed documents are accumulating in the queue, and a parsed XML may take quite a lot of memory (from some Mo to tens of them for big inventories).
At that point, we reach a classical JVM memory exauhstion, where the GC can't free sufficient memory compared to what is needed by for the next action, and so it spend more and more time trying to free memory when there is even less and less available.
If we send inventory less frequently (one every ten seconds in our tests) so that step 3/ can be completed before a new inventory arrive, we were able to sustain the rececption of hundreds of inventories without any impact on performances.
We suspect that that problem may be the root cause of several reported staling of Rudder web application, like #4425
Solution:
The first (easy) step is to have two seperated java web server (jetty or other) so that each of them does not impact the other (for reference, an endpoint need less than 256Mo of heap space to work correcly when the queue is bounded).
A second possibility (or step) is to bound the max number of queued inventories allowed in the endpoint.
A third possibility (evolution) is to transform what is today the "endpoint" web application into a deamon in charge of reading inventory files in the incoming directory and processing them (actually limiting the number of processed inventory to "one", or an other max number chosen knowing the concurrent possibilities of the machine).
Updated by François ARMAND over 10 years ago
- Subject changed from Sending lots of inventory to Rudder endpoint may exausht available memory and impact Rudder Web UI to Sending lots of inventories to Rudder endpoint may exhaust available memory and lead Rudder Web UI to stalling
Updated by François ARMAND over 10 years ago
For this one, I will only track the "limit the queue size" correction.
Updated by François ARMAND over 10 years ago
- Assignee set to Nicolas CHARLES
- Pull Request set to https://github.com/Normation/ldap-inventory/pull/27
A PR here. No migration script for now (one needed).
Updated by Nicolas CHARLES over 10 years ago
- Assignee changed from Nicolas CHARLES to François ARMAND
Francois, I made a remark on the error code, otherwise everything looks fine
Updated by François ARMAND over 10 years ago
- Target version changed from 2.6.11 to 2.10.0~beta1
That's quite a big change behaviour, so targeting in 2.10
Updated by François ARMAND over 10 years ago
- Pull Request changed from https://github.com/Normation/ldap-inventory/pull/27 to https://github.com/Normation/ldap-inventory/pull/28
Updated by François ARMAND over 10 years ago
The pull requested is re-targeted to Rudder 2.10, and when just miss the migration script.
But this "bug" should be requalified as a new feature for 2.10, so I need some work requalifying it.
Updated by François ARMAND over 10 years ago
- Status changed from 8 to Pending release
- % Done changed from 0 to 100
Applied in changeset ldap-inventory:commit:516d0c2d8a483bdb76cfe80da043c7269448538e.
Updated by Jonathan CLARKE over 10 years ago
Applied in changeset ldap-inventory:commit:1a200568eef5d2dc85c3ac60080d68ef1211349d.
Updated by Vincent MEMBRÉ over 10 years ago
- Tracker changed from Bug to User story
- Subject changed from Sending lots of inventories to Rudder endpoint may exhaust available memory and lead Rudder Web UI to stalling to Limit number of inventory queued by Rudder inventory endpoint to avoid memory exhaustion and Rudder web UI freezing
Updated by Vincent MEMBRÉ over 10 years ago
- Tracker changed from User story to Bug
- Pull Request set to https://github.com/Normation/ldap-inventory/pull/28
Updated by Vincent MEMBRÉ over 10 years ago
- Subject changed from Limit number of inventory queued by Rudder inventory endpoint to avoid memory exhaustion and Rudder web UI freezing to Rudder web UI freezes when too many inventory are received at the same time
Updated by Vincent MEMBRÉ over 10 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 2.10.0~beta1, which was released today.
Check out:
The release announcement: http://www.rudder-project.org/pipermail/rudder-announce/2014-March/000084.html
The full ChangeLog: http://www.rudder-project.org/foswiki/bin/view/System/Documentation:ChangeLog210
Download information: https://www.rudder-project.org/site/get-rudder/downloads/