Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NethCTI 3: rest api "extensions" performance improvement #5700

Closed
alepolidori opened this issue Sep 18, 2019 · 17 comments
Closed

NethCTI 3: rest api "extensions" performance improvement #5700

alepolidori opened this issue Sep 18, 2019 · 17 comments
Labels
nethcti Relative to NethCTI client or server verified All test cases were verified successfully
Milestone

Comments

@alepolidori
Copy link

Description

On a large installation (~1000 users), the rest api extensions of asterisk proxy component stress the cpu and takes a long time. This can cause clients disconnection or disconnection from Asterisk server based on the available machine resources.
Implementing this performance improvements represents a first step to make cti application more scalable.

Steps to reproduce

  • make an installation of 1000 users
  • login to cti
  • verify that cpu usage is high (about 100%)
  • you can verify on the developer tools of the client that the involved rest api takes a long time to receive an answer

Expected behavior

Rest api have to be executed in a reasonable amount of time, based on the number of the returned extensions.

Actual behavior

The rest api take a long time an high cpu usage on the server.

Components

Cti server.

@alepolidori alepolidori self-assigned this Sep 18, 2019
@alepolidori alepolidori added enhancement nethcti Relative to NethCTI client or server labels Sep 18, 2019
@alepolidori alepolidori added this to the NethVoice 14 milestone Sep 18, 2019
@alepolidori alepolidori changed the title NethCTI 3: rest api "extensions" performance improvements NethCTI 3: rest api "extensions" performance improvement Sep 18, 2019
@alepolidori
Copy link
Author

Cause

Due to the need of clients to have the associated username for each extension, the server calculated it for each request of extensions. This was to maintain an abstraction login of independence between user component and astproxy one. This is slow with a lot of users and extensions.

Solution

The association is executed one time at boot by the user component.
It takes just 13 msec on a local virtualbox machine (2 core and 1G ram) with 1000 users and 2000 extensions.

Results of improvement

Time takes by extensions api before the fix:

  • 8.27s ~ 12.6 KB

Time takes by extensions api after the fix:

  • 24ms ~ 12.91 KB

@nethbot
Copy link
Member

nethbot commented Sep 18, 2019

in 7.6.1810/nethesis-testing:

  • nethcti-server3-3.16.1-1.2.g60f5ac1.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.2.g60f5ac1.ns7.x86_64.rpm x86_64

@alepolidori
Copy link
Author

alepolidori commented Sep 18, 2019

How to test

  • before installation of the fix, open chrome dev tools -> network and take a note of the rest api astproxy/extensions durantion
  • install the fix
  • repeat the first step
  • verify that rest api duration has decreased
  • take a look also at cpu usage on the server during the test using top command for example

Note: the change on rest api duration is more evident on an installation with a lot of users

@alepolidori alepolidori removed their assignment Sep 18, 2019
@alepolidori alepolidori added the testing Packages are available from testing repositories label Sep 19, 2019
@andrea-marchionni andrea-marchionni added verified All test cases were verified successfully and removed testing Packages are available from testing repositories labels Sep 19, 2019
alepolidori pushed a commit to nethesis/nethcti-server that referenced this issue Oct 4, 2019
@nethbot
Copy link
Member

nethbot commented Oct 4, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.1.ge4a7a1b.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.1.ge4a7a1b.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 7, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.2.g20396c1.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.2.g20396c1.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 10, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.3.g76dd8d9.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.3.g76dd8d9.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 11, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.4.g322e88b.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.4.g322e88b.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 11, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.5.ga5c455a.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.5.ga5c455a.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 11, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.6.g0705086.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.6.g0705086.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 14, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.7.gc59269f.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.7.gc59269f.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 15, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.8.g7b523ad.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.8.g7b523ad.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 15, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.8.g9146106.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.8.g9146106.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 15, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.9.g65ab281.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.9.g65ab281.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 15, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.10.g81200cc.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.10.g81200cc.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 21, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.11.g3d31189.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.11.g3d31189.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 21, 2019

in 7.7.1908/nethesis-testing:

  • nethcti-server3-3.16.1-1.12.g4f754bf.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.16.1-1.12.g4f754bf.ns7.x86_64.rpm x86_64

@nethbot
Copy link
Member

nethbot commented Oct 23, 2019

in 7.7.1908/nethesis-updates:

  • nethcti-server3-3.17.0-1.ns7.x86_64.rpm x86_64
  • nethcti-server3-debuginfo-3.17.0-1.ns7.x86_64.rpm x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nethcti Relative to NethCTI client or server verified All test cases were verified successfully
Projects
None yet
Development

No branches or pull requests

3 participants