Excess cpu (node)

hello Chris, good job, trudesk is excellent

the node process consumes excess cpu

Command node /etc/trudesk/app.js

Trudesk version 1.0.3
Ubuntu 16.04
installed via > - curl -L -s Trudesk Cloud – Free Cloud & Open-Source Help Desk / CRM - Trudesk | sudo bash

Thank you for the report.
Can you please see https://github.com/polonel/trudesk/issues/117 and tell me what is in common in your use case.

can you show pm2 status and pm2 logs trudesk

Can you please see Trudesk out of memory ( aws t2.medium ec2 ) · Issue #117 · polonel/trudesk · GitHub and tell me what is in common in your use case.

It may be similar, my installation was done with “Ubuntu Install Script”. No additional configuration

Also why is there so many app.js processes and mongod processes? The script only launches 1 process.
is the “standard” configuration of the script

an you show pm2 status and `pm2 logs trudesk

So the mailer is having an error every cycle because it is not configured correctly. There is no from address set in the mailer settings. Please set a from address to prevent the server from having this error. Lets see if that helps the CPU usage after this change and a pm2 restart trudesk

note: a variable check has been deployed to develop branch to prevent this error.

hello Polonel,

I did several tests and came to the following conclusion

the problem is when you open the application on android
perform the closing of the trudesk session but the problem continues (cpu increases)!!

Thank you for this contribution to help identify the issue.

Just to clarify, this is the android app from google play and not the mobile site on android?

I can confirm this. Working on a fix.

Thank you for the help in troubleshooting the issue.

I detected it in google play application
it seems that the problem is also from the browser from android

thanks to you…

I’m seeing a small rise in CPU when the app should be idle. I’m trying to get the major increase in CPU as you have.

Information on my test env for this case.

  • VMWare vSphere 6.0
  • VM Specs: 2 Socket 2 Core. 4GB RAM
  • Ubuntu 16.04 install using Install Script.
  • Elasticsearch NOT installed
  • MongoDB IS installed
  • Took all default values during web install
  • DID NOT configure anything in settings
  • Connected Android app to server instance
    – Inside android app I did
    — Create Ticket, Comment Ticket, Assign user, Change Status, And closed ticket
    — Uploaded profile picture, Clicked on the chat tab (Connects to chat server)
  • Create a new user (Support)
  • Logged in to user account from multiple browser windows (chrome incognito)
  • Chat between users both in browser and from android app as well as android browser.
  • Created 5 more tickets from PC Browser.
  • Logged out of Android app and back in
  • Closed android app without logging out
  • Closed all web browsers.

So the server should be in an idle state (minus a few task that run every 10min & every hour) and I’m seeing a jitter ~3% increase with a max of 10% CPU after an hour. I see memory usage at around 150mb, which is high for a new deployment. So definitely there is an issue somewhere.

I have a couple of questions.

  1. Does the raise of CPU happen just by opening the app? (sitting idle)
  2. Does it occur with only 1 user logged in?
  3. What does your memory usage look like?
  4. What are the specs of your VM (CPU, Memory)?
  5. Did you configure anything inside settings (mailer, mail check, push service)?

I really appreciate the time spent in helping locate this issue. Its been a pain for me to reproduce it. I’ve checked active clients running v1.0.3 on linux and haven’t seen the issue.
The help is much appreciated.

I want to reproduce the large steady increase as you show in the VMware graph.

Thanks,
Chris

summary
I made a few quick tests. it seems that the problem is in a single user
a new user does not generate the cpu increase

next week (next year: P) I give you more details

Note: I can not delete the Token Mobile APIs
remove%20token2

I’m have very difficult time to reproduce. I’ve setup an alert in VMWare on the CPU usage for the given machine used to test this. I have used it daily for 10 days with the android and ios app and have yet to see it go over 40% CPU (consistently)

Any further information you can provide would be greatly appreciated.

Do you have the mail check feature enabled?

Please update to v1.0.5

There was an event leak that was causing high CPU usage when using the mailcheck feature.

Hi Polonel

mail check is deactivated

The problem appears only when you use the android application

if you use the system from a desktop PC it never happens

Can you check the following for me: