> On 17 Jan 2019, at 4:15 pm, Himmat Rana <rana.him...@gmail.com> wrote: > > We have using new relic as monitoring tools. we have both I/O and CPU > intensive task. > our server response time is around 2sec and around 102rpm > > Currently we are using default daemon settings (1 process and 15 threads). > > Some time our server got hanged due to memory then we have to restart apache.
Are you saying that even now with that MPM configuration and daemon mode process settings, you are using 8gb of memory. How much memory do the WGSI application processes themselves use? And how much memory is Apache as a whole using? Are you at least setting: WSGIRestrictEmbedded On to disable initialisation of Python interpreters in Apache child worker processes. This will also cause 500 errors if you haven't actually correctly set things up to run the WSGI application in daemon mode, so good to have it, as it will flag wrong configuration. Am wondering if you are using daemon mode, as 1 process and 15 threads isn't enough capacity to handle 100 rpm at 2 seconds per request. It is only enough to handle 30rpm. What we can change it to, can only suggest after better understand what is using all the memory. Graham > > Sorry for my bad english. > > > > On Thursday, 17 January 2019 10:31:13 UTC+5:30, Graham Dumpleton wrote: > > >> On 17 Jan 2019, at 3:56 pm, Himmat Rana <rana....@gmail.com <>> wrote: >> >> >> Hi Graham, >> >> we have a live server with configuration (c4.xlarge) 4core with 8gb ram and >> apache with MPM event module >> >> can you suggest processs and threads in mod_wsgi deamon ? > > What are you using now? > > It is impossible to really give advice without knowing the amount of traffic > your Python WSGI applications gets, response times, whether I/O bound or CPU > intensive. Do you have any monitoring in place at all? > > Graham > >> >> >> apache mpm configuration >> >> >> # event MPM >> # StartServers: initial number of server processes to start >> # MinSpareThreads: minimum number of worker threads which are kept spare >> # MaxSpareThreads: maximum number of worker threads which are kept spare >> # ThreadsPerChild: constant number of worker threads in each server process >> # MaxRequestWorkers: maximum number of worker threads >> # MaxConnectionsPerChild: maximum number of requests a server process serves >> <IfModule mpm_event_module> >> StartServers 3 >> MinSpareThreads 25 >> MaxSpareThreads 75 >> ThreadLimit 64 >> ThreadsPerChild 25 >> MaxRequestWorkers 200 >> MaxConnectionsPerChild 1000 >> </IfModule> >> >> On Thursday, 17 January 2019 08:00:25 UTC+5:30, Graham Dumpleton wrote: >> >> >>> On 17 Jan 2019, at 1:27 pm, Himmat Rana <rana....@gmail.com <>> wrote: >>> >>> Thanks Graham for your quick response >>> >>> >>> Can I use restart-interval parameter in live server >> >> On manually configured Apache/mod_wsgi when using daemon mode, yes, just be >> careful about how frequently you do it. Making it 1 second would be a very >> bad idea for example. >> >> For some reasonable starting defaults to consider when manually configuring, >> based on what mod_wsgi-express uses, see my talk: >> >> * https://www.youtube.com/watch?v=CPz0s1CQsTE >> <https://www.youtube.com/watch?v=CPz0s1CQsTE> >> >> Graham >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>. >> To post to this group, send email to mod...@ <>googlegroups.com >> <http://googlegroups.com/>. >> Visit this group at https://groups.google.com/group/modwsgi >> <https://groups.google.com/group/modwsgi>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to modwsgi+unsubscr...@googlegroups.com > <mailto:modwsgi+unsubscr...@googlegroups.com>. > To post to this group, send email to modwsgi@googlegroups.com > <mailto:modwsgi@googlegroups.com>. > Visit this group at https://groups.google.com/group/modwsgi > <https://groups.google.com/group/modwsgi>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+unsubscr...@googlegroups.com. To post to this group, send email to modwsgi@googlegroups.com. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.