It also seems that now that that daemon mode is being used, I'm seeing a lot of "Generating diff chunks for self.filediff id ... took (>15 seconds)"
Our SCM is perforce, I wonder if using multiple threads is hitting some kind of limitation or is using some sort of lock with "p4 print". On Tuesday, January 29, 2019 at 8:28:01 AM UTC-6, Joshua Cannon wrote: > > I set up django_debug_toolbar to ignore DEBUG and only fire for myself > (I'm lucky we use SSO, so I can verify myself through the X509 cert instead > of via IP, which changes). What I was seeing was new loading of initial > state. > > What I finally discovered was the old server had configured prefork_mpm > (in httpd.conf, which I didn't check to look), whereas I had not (I > would've assumed if no values were provided some defaults would've been > used but that was not seemingly the case). > > The documentation I was referring to is at > https://www.reviewboard.org/docs/manual/3.0/admin/installation/creating-sites/#beginning-installation > under > "Apache should use the Prefork MPM". > > > On Monday, January 28, 2019 at 6:49:53 PM UTC-6, Christian Hammond wrote: >> >> We find that mod_wsgi daemon mode works well for us. It won't solve the >> template rendering issue, but template structures are cached after their >> first parse (the cache is local per-process), so long as DEBUG=False. If >> you're seeing this on every page load, it could be due to DEBUG being set >> to True (if you're running django_debug_toolbar, this very likely may be >> happening), or you're just seeing new threads/processes loading initial >> state on first request. >> >> The URLResolver structure does have to be built for each new process as >> well, and there's no getting around that, but this is a first-time startup >> cost, and users shouldn't be seeing it on-going unless processes are >> frequently being re-launched. >> >> You'll also see some slowdown if using a network filesystem to store the >> Python packages (rare, but we've seen this happen). Those should always be >> local. As should the site directory. >> >> Running daemon mode with a multi-threaded setup should minimize these. >> Most of the data will be loaded either immediately on startup or on first >> request (per process), and shared amongst all threads. The processes should >> rarely recycle as well, as it's mostly the threads that will be discarded >> and re-created periodically. >> >> We used to only recommend single-threaded setups before, due to some bugs >> in third-party libraries and a couple in ours, but that hasn't been an >> issue in a long while. Do we have some stale docs still recommending this >> that you saw? >> >> Christian >> >> On Mon, Jan 28, 2019 at 3:13 PM Joshua Cannon <[email protected]> wrote: >> >>> Howdy folks! >>> >>> My users were complaining about slow performance after we re-provisioned >>> our VM from scratch. >>> >>> After doing some sleuthing using django_debug_toolbar, I found a couple >>> of templates were taking a significant amount of time. The first was >>> "base/_mobile_navbar.html". After some profiling of rendering the template, >>> I found out the time is spent populating the URLResolver's internal data >>> structure for all the regular expressions. Every time I refresh the page, I >>> see the same template take the same amount of time, which tells me apache >>> isn't re-using the processes between requests (or something, I'm not really >>> a good sysadmin). >>> >>> I found that Django recommends deploying using mod_wsgi in daemon mode >>> <https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/modwsgi/#using-mod-wsgi-daemon-mode>. >>> >>> But I also noticed our previous incarnation of the server didn't have this >>> enabled. >>> >>> What settings do y'all suggest to ensure each request isn't spending >>> lots of time rendering templates? I see y'all recommned using the >>> single-threaded Prefork MPM, should I configure WSGI daemon to also be >>> single-threaded? >>> >>> Thanks! >>> >>> -- >>> Supercharge your Review Board with Power Pack: >>> https://www.reviewboard.org/powerpack/ >>> Want us to host Review Board for you? Check out RBCommons: >>> https://rbcommons.com/ >>> Happy user? Let us know! https://www.reviewboard.org/users/ >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Review Board Community" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> -- >> Christian Hammond >> President/CEO of Beanbag <https://www.beanbaginc.com/> >> Makers of Review Board <https://www.reviewboard.org/> >> > -- Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/ Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/ Happy user? Let us know! https://www.reviewboard.org/users/ --- You received this message because you are subscribed to the Google Groups "Review Board Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
