Comments (3)
Which version of nginx and module are you using?
The latest code should avoid this CPU starvation.
A large number on count may slow down the redis.
If you need to purge content frequently may be better to set a lower value
to it instead of purge it actively.
On May 20, 2015 19:29, "Vedran" [email protected] wrote:
Hello,
I have tens of millions of files in cache and purge request causes 1000s
of consecutive SCAN ... MATCH ... COUNT 100 queries being performed against
redis which slows down nginx, making it completely saturate cpu cores
during the purge (which is quite often).Increasing COUNT from 100 to 1000000 in code resolves this issue (thus it
only needs to execute a couple of queries), however when redis reply is
lengthier (in my case it was over 1000 keys in a single reply) purge
doesn't seem to work and I never get a reply from nginx. I noticed it fails
to send subsequent queries to redis with a new cursor so I guess it just
hangs after reading the first batch from redis. There are no errors in logs
and it continues to issue SETEX commands to redis just fine.There's one more thnig. If I reload nginx while the purge is being
performed, old process ("worker process is shutting down") goes into loop
(using 100% of cpu) filling the log with "[alert] 8677#0: *696760740 header
already sent, ..." until I kill it (with sigkill, term doesn't work).Regards,
Vedran—
Reply to this email directly or view it on GitHub
#1
.
from nginx-selective-cache-purge-module.
Both are latest version (nginx 1.8 and up to date selective-cache-purge-module)
I just noticed it's using a separate nginx worker for redis communication so that's why delivery appears to be unaffected by cpu usage. However, would it be possible to specify low scheduling priority (10-15) and specific cpu core (using ngx_setaffinity) so that it doesn't share the same as workers doing content delivery? As currently both delivery and purge workers are competing for cpu time on a same cpu core.
Regards,
Vedran
from nginx-selective-cache-purge-module.
Hmm, you can ignore that last comment, it appears those were some stale workers left over after nginx was reloaded. I'm going to close this for now and will look more into it over the next few days.
Thanks,
Vedran
from nginx-selective-cache-purge-module.
Related Issues (15)
- Performance on purging cache HOT 7
- Subrequest for purge never returns when called from lua HOT 3
- segfaults on reload HOT 3
- Add PURGE method example to the readme HOT 2
- Redis question HOT 2
- what's the relationship between Redis data and nginx cache keys zone? HOT 3
- error build with nginx-1.12.2 HOT 4
- selective_cache_purge_redis_database per server? HOT 1
- io_destroy() error everytime nginx starts HOT 12
- Support for Cache Tags HOT 1
- Same here
- Synchronizer crashes with nginx 1.10 HOT 1
- ngx_slab_alloc() failed: no memory HOT 10
- Nginx worker stops on big purge with 100% cpu usage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-selective-cache-purge-module.