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

High CPU in mora and nginx after upgrade to 0.10 with external MongoDB #206

Closed
mafiu opened this issue Jan 8, 2016 · 5 comments
Closed
Assignees
Milestone

Comments

@mafiu
Copy link

mafiu commented Jan 8, 2016

Hi,

I recently upgraded API-Umbrella from 0.8 to 0.10 without problem, I've tested the aplication locally with local general_db.

The problem ocurred when I change the configuration to use an external mongodb server (In replicaset) and the CPU used by mora and nginx went too high (~100%) and doesn't go down.

In logs I can't see anything related to this.
Anyone has the same problem?

@GUI
Copy link
Member

GUI commented Jan 8, 2016

Hm, I can't think of anything that would be causing this off-hand, but what version of mongodb is your external replicaset running? How many nodes are in the replicaset? Is it using authentication, sharding, or any other configuration you can think of that differs from a stock mongodb setup?

@mafiu
Copy link
Author

mafiu commented Jan 8, 2016

Hi Gui,

I've tested with mongodb 3.02 (with auth) and 3.2 (without auth), with 3 nodes and no sharding.
The same config was working on API-Umbrella 0.8

OS: CentOS 6 x64

@mafiu
Copy link
Author

mafiu commented Jan 11, 2016

Hi Gui,

The problem is with mongodb 3+, I've tried with mongodb 2.6.11 and I don't have the same issue.
API-Umbrella 0.8 hasn't this problem.

@GUI
Copy link
Member

GUI commented Jan 14, 2016

Very strange. We've actually been doing all our testing of API Umbrella v0.9+ against MongoDB 3.0 (more specifically 3.0.7), so the fact that this is fixed by downgrading to 2.6 is odd. I don't think we're using any Mongo 3 functionality, so sticking with 2.6 should be fine, but it would be nice to understand what's going on.

I'll try to reproduce this with different setups, but in the meantime, do you know if anything was printed to the /var/log/api-umbrella/mora/current log file when this happened? You can also look in the logrotated files if you want to look back to the day this might have occurred (eg /var/log/api-umbrella/mora/current-20160109.gz). If anything is in that log file, that would be super helpful to know. Similarly, if you said nginx was also hogging CPU when this happened, I'd also be interested if there is anything in the nginx error log (/var/log/api-umbrella/nginx/current*).

@GUI GUI added this to the v0.11 milestone Jan 21, 2016
@GUI GUI self-assigned this Jan 21, 2016
@GUI
Copy link
Member

GUI commented Jan 21, 2016

Thanks for reporting this. I think I discovered what might trigger this scenario with regards to authentication. The bug causing high CPU usage should be resolved in the new v0.11 packages that are now out: https://github.com/NREL/api-umbrella/releases/tag/v0.11.0

However, there are some additional caveats with enabling authentication in MongoDB 3.0 (but these don't apply to 2.6, as I think you've discovered). I've added a new documentation page outlining the process for enabling authentication on 3.0, so hopefully that helps clear things up: http://api-umbrella.readthedocs.org/en/latest/server/db-config.html#mongodb-authentication

The bug was fixed in f01ebd2

Let us know if you're still seeing any issues or encountering any problems with an authenticated setup.

@GUI GUI closed this as completed Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants