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 usage on heavy traffic #107

Open
Vladislavik opened this issue Jun 11, 2022 · 2 comments
Open

high cpu usage on heavy traffic #107

Vladislavik opened this issue Jun 11, 2022 · 2 comments

Comments

@Vladislavik
Copy link

Hi is there any advice or other when i try to use this module on a high load server nginx starts to consume a lot of cpu is there any caches for the found ip data in the database not to look it up again on the next request from the same ip or any other recommendation to reduce cpu usage. Almost on ddos it is 100% CPU usage with nginx...

@leev
Copy link
Owner

leev commented Jun 13, 2022

I would start with generating a flamegraph of the server when it's not under attack and when it is under attack. That will help with identifying where the CPU increase is and if it is in fact due to geo IP look up.

Right now, there is no caching of geoip information between requests.

@tobias992
Copy link

Hello @leev,

first thank you for this nice nginx module. We also use it on every our servers for country blocking and in case of ddos attacks. I really have no idea how to program a nginx module but there is a efficient way to improve the performance of this module?

How this module works in detail?

  1. The geoip database is loaded into RAM on nginx start/reload
  2. Every nginx request is checked from database on local disk

If 2, maybe it could improve the performance to copy the geoip database into tmpfs directory because of faster RAM?

Because we also can see high cpu load on high traffic servers with active geoip2 module. We also would pay for a nice performance update.

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

3 participants