Project

General

Profile

Actions

Bug #4497

closed

Rudder web UI freezes when too many inventory are received at the same time

Added by François ARMAND about 10 years ago. Updated about 10 years ago.

Status:
Released
Priority:
N/A
Category:
Performance and scalability
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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).


Subtasks 4 (0 open4 closed)

Bug #4522: Adapt send-clean.sh script to retry inventory sending when endpoint returns 503 codeReleasedJonathan CLARKE2014-02-25Actions
Bug #4523: Migration script to add waiting.inventory.queue.size property to configurationReleasedJonathan CLARKE2014-02-25Actions
Bug #4646: 'waiting.inventory.queue.size' property not added in correct property fileReleasedJonathan CLARKE2014-03-18Actions
Bug #4656: missing directory in spec, cannot build on rpmReleasedVincent MEMBRÉ2014-03-19Actions

Related issues 2 (0 open2 closed)

Related to Rudder - Bug #4425: Rudder should not query all nodes when checking loginRejectedFrançois ARMAND2014-01-31Actions
Related to Rudder - Bug #4349: Switching tabs in the webapp is extremely slowRejected2014-01-13Actions
Actions #1

Updated by François ARMAND about 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
Actions #2

Updated by François ARMAND about 10 years ago

For this one, I will only track the "limit the queue size" correction.

Actions #3

Updated by François ARMAND about 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).

Actions #4

Updated by Nicolas CHARLES about 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

Actions #5

Updated by François ARMAND about 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

Actions #6

Updated by François ARMAND about 10 years ago

  • Pull Request changed from https://github.com/Normation/ldap-inventory/pull/27 to https://github.com/Normation/ldap-inventory/pull/28
Actions #7

Updated by François ARMAND about 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.

Actions #8

Updated by François ARMAND about 10 years ago

  • Status changed from 8 to Pending release
  • % Done changed from 0 to 100

Applied in changeset ldap-inventory:commit:516d0c2d8a483bdb76cfe80da043c7269448538e.

Actions #9

Updated by Jonathan CLARKE about 10 years ago

Applied in changeset ldap-inventory:commit:1a200568eef5d2dc85c3ac60080d68ef1211349d.

Actions #10

Updated by Vincent MEMBRÉ about 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
Actions #11

Updated by Vincent MEMBRÉ about 10 years ago

  • Tracker changed from User story to Bug
  • Pull Request set to https://github.com/Normation/ldap-inventory/pull/28
Actions #12

Updated by Vincent MEMBRÉ about 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
Actions #13

Updated by Vincent MEMBRÉ about 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/
Actions

Also available in: Atom PDF