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







                    MQUG14UBLj IysF,OGSaDC4t3ONO,jxqT3Qv1QWt,CjHKvvY tn78a,lKu8UbUUFn,eVi
                    QSI1C2,kdy3eH,M6bZYsKiU l50xLLtAGn 6M 5VM,weOuD3,g,gRzUKsbJ1

                    Popular posts from this blog

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    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