Analyze uwsgi strace log to find out why it takes high CPU usageLong 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

Will 700 more planes a day fly because of the Heathrow expansion?

What are the advantages of luxury car brands like Acura/Lexus over their sibling non-luxury brands Honda/Toyota?

Out of scope work duties and resignation

What to use instead of cling film to wrap pastry

Word meaning as function of the composition of its phonemes

Can my company stop me from working overtime?

Nominativ or Akkusativ

Adjacent DEM color matching in QGIS

29er Road Tire?

Why is "breaking the mould" positively connoted?

What was the first story to feature the plot "the monsters were human all along"?

How can I get a job without pushing my family's income into a higher tax bracket?

Are Finitely generated modules over a ring also finitely generated over a subring containing the identity?

Where can I go to avoid planes overhead?

List of newcommands used

Are the Night's Watch still required?

IP addresses from public IP block in my LAN

Causes of bimodal distributions when bootstrapping a meta-analysis model

Identifying characters

How should I tell my manager I'm not paying for an optional after work event I'm not going to?

Word for Food that's Gone 'Bad', but is Still Edible?

Are pressure-treated posts that have been submerged for a few days ruined?

Copy previous line to current line from text file

60s/70s science fiction novel where a man (after years of trying) finally succeeds to make a coin levitate by sheer concentration



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


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], 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], 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






























    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], 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], 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


























      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], 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], 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], 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], 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.5k15114196




      43.5k15114196










      asked Nov 9 '11 at 21:46









      chenxeechenxee

      214




      214




















          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

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company