Posts

Showing posts with the label usage

Fix 100% CPU usage by w3wp.exe (IIS 7)

One of my windows servers was using 100% CPU very often. Every time it encountered that usage level, I had to restart the server. That fixed the issue at that time but then It would come back later. So after looking deeper into the problem for a while, I finally figured out what causing it and how to fix it. It's the w3wp.exe process which is the IIS worker process that eating all the CPU for some reasons. Then the workaround is to increase the number of worker per app in IIS Manager: 1.Go to Start > Control Panel > Administrative Tools > Internet Information Services (IIS) Manager. 2. Expand the view to [Server Name] > Application Pools. 3. Right click on your app pool and select Advanced Settings.... 4. Under Process Model section, set the Maximum Worker Processes... to 2 or higher. 5. Click on OK to save the settings. 6. Restart the App Pool by right clicking and select Stop then Start. 7. Make sure the session stays in all processes: - Go to Start ...

Django + Celery + Eventlet - Reduce memory usage

Image
Running celery with django seems to eat a lot of memory. So, I looked for a way to manage (reduce) the concurrent celery workers. Then, I found Eventlet: "Eventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it." "Celery supports Eventlet as an alternative execution pool implementation. It is in some cases superior to multiprocessing, but you need to ensure your tasks do not perform blocking calls, as this will halt all other operations in the worker until the blocking call returns. The multiprocessing pool can take use of multiple processes, but how many is often limited to a few processes per CPU. With Eventlet you can efficiently spawn hundreds, or thousands of green threads. In an informal test with a feed hub system the Eventlet pool could fetch and process hundreds of feeds every second, while the multiprocessing pool spent 14 seconds processing 100 feeds. Note that is one of the applicat...

RabbitMQ - Limit memory usage

Image
To limit the memory usage of RabbitMQ, run the following command (.e.g: to 20%): $ sudo rabbitmqctl set_vm_memory_high_watermark 0.2 Check the log of rabbitmq at /var/log/rabbitmq/rabbit@<your_hostname>.log: