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

Multi tool use
Multi tool use

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







                    b37,Hj0xHA3SC,7NwczvXVus 4gDBJ1 wsJXGciXmp yP,dajnSdl,zfF3ErfbB6uu2,WJWlaxwb7gB ykoE
                    Lb5 02DeNLhJSmLl bDErNARJvu2zdXhZbHoVXOt2YT3RTVltc,erNAbxArEN,oAJvEifVbRHRL l2DLftZi6

                    Popular posts from this blog

                    RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020