Analyze uwsgi strace log to find out why it takes high CPU usage Unicorn Meta Zoo #1: Why...

Has a Nobel Peace laureate ever been accused of war crimes?

Visa-free travel to the US using refugee travel document from Spain?

Arriving in Atlanta after US Preclearance in Dublin. Will I go through TSA security in Atlanta to transfer to a connecting flight?

Retract an already submitted recommendation letter (written for an undergrad student)

Split coins into combinations of different denominations

Can you stand up from being prone using Skirmisher outside of your turn?

Multiple fireplaces in an apartment building?

What is the term for a person whose job is to place products on shelves in stores?

Why is this method for solving linear equations systems using determinants works?

What's parked in Mil Moscow helicopter plant?

What is ls Largest Number Formed by only moving two sticks in 508?

Is there any hidden 'W' sound after 'comment' in : Comment est-elle?

Suing a Police Officer Instead of the Police Department

Seek and ye shall find

Is Diceware more secure than a long passphrase?

What is a 'Key' in computer science?

Raising a bilingual kid. When should we introduce the majority language?

Check if a string is entirely made of the same substring

What is the ongoing value of the Kanban board to the developers as opposed to management

How to use @AuraEnabled base class method in Lightning Component?

What is this word supposed to be?

Implementing 3DES algorithm in Java: is my code secure?

Justification for leaving new position after a short time

Could Neutrino technically as side-effect, incentivize centralization of the bitcoin network?



Analyze uwsgi strace log to find out why it takes high CPU usage



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Come Celebrate our 10 Year Anniversary!Long connection times from PHP to MySQL on EC2How do I allow mysqld to use more than 24.9% of my cpu?mysql - abnormally high CPU usageNginx php-fpm high cpu usageMongoDB high CPU usagenginx can't execute many requestsUbuntu 12.04 high cpu usagephp-fpm and nginx @ high CPU usage?PHP High CPU usagephp5.6-fpm high cpu usage





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







4















I'm running a django site with nginx through uwsgi. The problem is uwsgi process take a lot of CPU time when traffic become heavy. The same configuration works fine on test server and siege/ab simulate heavy concurrent traffic.



Here is one strace log of uwsgi process. http://dl.dropbox.com/u/43017476/strace.log



And some sysctl:



fs.file-max = 128000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.core.netdev_max_backlog = 4096
net.ipv4.tcp_max_syn_backlog = 4096
net.core.somaxconn = 250000
net.ipv4.tcp_keepalive_time = 300


nginx conf is pretty same as other tutorials from Google. I have been trying to figure it out but no luck. However I found a lot of this pieces:



22:12:02.932276 read(8, "722", 16384) = 11
22:12:02.932504 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
22:12:02.932547 write(8, "173SET NAMES utf8", 19) = 19
22:12:02.932643 read(8, "712", 16384) = 11
22:12:02.933237 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
22:12:02.933279 write(8, "213set autocommit=0", 21) = 21
22:12:02.933330 read(8, "71", 16384) = 11


Whereas file descriptor 8 is a mysql socket. But Mysql server seems working pretty fine. I can see each "read" system call consumes most CPU time but don't know what's going wrong here. The same database server has been serving former PHP site without problem.



Any ideas appreciated.










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    4















    I'm running a django site with nginx through uwsgi. The problem is uwsgi process take a lot of CPU time when traffic become heavy. The same configuration works fine on test server and siege/ab simulate heavy concurrent traffic.



    Here is one strace log of uwsgi process. http://dl.dropbox.com/u/43017476/strace.log



    And some sysctl:



    fs.file-max = 128000
    net.core.rmem_max = 16777216
    net.core.wmem_max = 16777216
    net.ipv4.tcp_rmem = 4096 87380 16777216
    net.ipv4.tcp_wmem = 4096 65536 16777216
    net.core.netdev_max_backlog = 4096
    net.ipv4.tcp_max_syn_backlog = 4096
    net.core.somaxconn = 250000
    net.ipv4.tcp_keepalive_time = 300


    nginx conf is pretty same as other tutorials from Google. I have been trying to figure it out but no luck. However I found a lot of this pieces:



    22:12:02.932276 read(8, "722", 16384) = 11
    22:12:02.932504 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
    22:12:02.932547 write(8, "173SET NAMES utf8", 19) = 19
    22:12:02.932643 read(8, "712", 16384) = 11
    22:12:02.933237 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
    22:12:02.933279 write(8, "213set autocommit=0", 21) = 21
    22:12:02.933330 read(8, "71", 16384) = 11


    Whereas file descriptor 8 is a mysql socket. But Mysql server seems working pretty fine. I can see each "read" system call consumes most CPU time but don't know what's going wrong here. The same database server has been serving former PHP site without problem.



    Any ideas appreciated.










    share|improve this question
















    bumped to the homepage by Community 6 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      4












      4








      4








      I'm running a django site with nginx through uwsgi. The problem is uwsgi process take a lot of CPU time when traffic become heavy. The same configuration works fine on test server and siege/ab simulate heavy concurrent traffic.



      Here is one strace log of uwsgi process. http://dl.dropbox.com/u/43017476/strace.log



      And some sysctl:



      fs.file-max = 128000
      net.core.rmem_max = 16777216
      net.core.wmem_max = 16777216
      net.ipv4.tcp_rmem = 4096 87380 16777216
      net.ipv4.tcp_wmem = 4096 65536 16777216
      net.core.netdev_max_backlog = 4096
      net.ipv4.tcp_max_syn_backlog = 4096
      net.core.somaxconn = 250000
      net.ipv4.tcp_keepalive_time = 300


      nginx conf is pretty same as other tutorials from Google. I have been trying to figure it out but no luck. However I found a lot of this pieces:



      22:12:02.932276 read(8, "722", 16384) = 11
      22:12:02.932504 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
      22:12:02.932547 write(8, "173SET NAMES utf8", 19) = 19
      22:12:02.932643 read(8, "712", 16384) = 11
      22:12:02.933237 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
      22:12:02.933279 write(8, "213set autocommit=0", 21) = 21
      22:12:02.933330 read(8, "71", 16384) = 11


      Whereas file descriptor 8 is a mysql socket. But Mysql server seems working pretty fine. I can see each "read" system call consumes most CPU time but don't know what's going wrong here. The same database server has been serving former PHP site without problem.



      Any ideas appreciated.










      share|improve this question
















      I'm running a django site with nginx through uwsgi. The problem is uwsgi process take a lot of CPU time when traffic become heavy. The same configuration works fine on test server and siege/ab simulate heavy concurrent traffic.



      Here is one strace log of uwsgi process. http://dl.dropbox.com/u/43017476/strace.log



      And some sysctl:



      fs.file-max = 128000
      net.core.rmem_max = 16777216
      net.core.wmem_max = 16777216
      net.ipv4.tcp_rmem = 4096 87380 16777216
      net.ipv4.tcp_wmem = 4096 65536 16777216
      net.core.netdev_max_backlog = 4096
      net.ipv4.tcp_max_syn_backlog = 4096
      net.core.somaxconn = 250000
      net.ipv4.tcp_keepalive_time = 300


      nginx conf is pretty same as other tutorials from Google. I have been trying to figure it out but no luck. However I found a lot of this pieces:



      22:12:02.932276 read(8, "722", 16384) = 11
      22:12:02.932504 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
      22:12:02.932547 write(8, "173SET NAMES utf8", 19) = 19
      22:12:02.932643 read(8, "712", 16384) = 11
      22:12:02.933237 poll([{fd=8, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
      22:12:02.933279 write(8, "213set autocommit=0", 21) = 21
      22:12:02.933330 read(8, "71", 16384) = 11


      Whereas file descriptor 8 is a mysql socket. But Mysql server seems working pretty fine. I can see each "read" system call consumes most CPU time but don't know what's going wrong here. The same database server has been serving former PHP site without problem.



      Any ideas appreciated.







      ubuntu mysql nginx django uwsgi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 '11 at 7:08









      quanta

      43.4k15114196




      43.4k15114196










      asked Nov 9 '11 at 21:46









      chenxeechenxee

      214




      214





      bumped to the homepage by Community 6 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 6 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          strace likely will not show you what is consuming CPU time as it shows system calls. The CPU time that a process is shown to consume is time that is spent executing code in the application itself. The read/write/poll you are showing is very likely normal MySQL communication, or is the application polling the mysql FD (non-blocking) to look for new traffic.



          I don't really have a solution for you as to how to find the cause of your high CPU, however I figured I would point you away from spending too much time looking for the answer in strace output :)






          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "2"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f329494%2fanalyze-uwsgi-strace-log-to-find-out-why-it-takes-high-cpu-usage%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            strace likely will not show you what is consuming CPU time as it shows system calls. The CPU time that a process is shown to consume is time that is spent executing code in the application itself. The read/write/poll you are showing is very likely normal MySQL communication, or is the application polling the mysql FD (non-blocking) to look for new traffic.



            I don't really have a solution for you as to how to find the cause of your high CPU, however I figured I would point you away from spending too much time looking for the answer in strace output :)






            share|improve this answer




























              0














              strace likely will not show you what is consuming CPU time as it shows system calls. The CPU time that a process is shown to consume is time that is spent executing code in the application itself. The read/write/poll you are showing is very likely normal MySQL communication, or is the application polling the mysql FD (non-blocking) to look for new traffic.



              I don't really have a solution for you as to how to find the cause of your high CPU, however I figured I would point you away from spending too much time looking for the answer in strace output :)






              share|improve this answer


























                0












                0








                0







                strace likely will not show you what is consuming CPU time as it shows system calls. The CPU time that a process is shown to consume is time that is spent executing code in the application itself. The read/write/poll you are showing is very likely normal MySQL communication, or is the application polling the mysql FD (non-blocking) to look for new traffic.



                I don't really have a solution for you as to how to find the cause of your high CPU, however I figured I would point you away from spending too much time looking for the answer in strace output :)






                share|improve this answer













                strace likely will not show you what is consuming CPU time as it shows system calls. The CPU time that a process is shown to consume is time that is spent executing code in the application itself. The read/write/poll you are showing is very likely normal MySQL communication, or is the application polling the mysql FD (non-blocking) to look for new traffic.



                I don't really have a solution for you as to how to find the cause of your high CPU, however I figured I would point you away from spending too much time looking for the answer in strace output :)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 7 '12 at 22:31









                FliesLikeABrickFliesLikeABrick

                18615




                18615






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f329494%2fanalyze-uwsgi-strace-log-to-find-out-why-it-takes-high-cpu-usage%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Фонтен-ла-Гаярд Зміст Демографія | Економіка | Посилання |...

                    Список ссавців Італії Природоохоронні статуси | Список |...

                    Маріан Котлеба Зміст Життєпис | Політичні погляди |...