<![CDATA[ Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL - My Forums]]> https://forums.modx.com/thread/?thread=104646 <![CDATA[Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562823
First of all, I'm not a progammer.

Because Site5 hosting arbitrarily changed A records without notifying us with some frequency and we had a lot of performance issues we moved two MODX based sites (each with 3 contexts) to A2 (A2 did a cPanel based migration from Site5).

Note: Both MODX based installs are up to date at 2.6.5 and Extras updated before the move.

Logged in the first time and everything was much faster.

However, an issue has arised that I cannot solve.

If we visit a context that is not the "web" context but another one with the correct Context Settings, ie.

base_url: /
http_host: domain.com
site_url: http://domain.com/

Obviously with real domains. The additional domains are Aliases in cPanel that point to public_html. At first was using ContextRouter for routing to contexts but have replaced it with xRouting. We have of course changed the A record for each domain to point to the new server.

Every context renders so we know that the A records are fine and redirecting to the correct context is at least partially fine.

But the issue is if we visit a URL for a context that is not "web" the server's CPU and Memory skyrockets and the sites eventually return a 500 error until after a few minutes when the server goes back to normal (we usually close the page we visited as well). When we go to the other context, of course, it's very slow right way, often refusing to render images.

So I'm thinking there has to be an issue with routing but I can't figure out what it is.

The main differences between the old server are:

PHP 7.1 instead of 5.6
Let's Encryt SSL is automatically installed

And the following was added to the standard MODX .htacess:

RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$


I commented them out but this made no difference.
MODX error log shows nothing.

On the other MODX install on A2 (different account then the other), when a user logs into the manager using a non "web" context again the server's CPU and Memory skyrockets and the sites eventually return a 500 error until after a few minutes when the server goes back to normal.

At first we thought it was bots hitting the sites in bulk but have use robots.txt to deny most of them.

My suspicion is it has something to do with the free SSL but we aren't trying to use https:// in any of the above situations.

Anyone have any ideas or have had a similar experience?]]>
rx2 Nov 19, 2018, 04:34 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562823
<![CDATA[Re: Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562848
]]>
BobRay Nov 20, 2018, 08:11 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562848
<![CDATA[Re: Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562845 rx2 Nov 20, 2018, 06:40 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562845 <![CDATA[Re: Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562834 BobRay Nov 19, 2018, 09:28 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562834 <![CDATA[Re: Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL (Best Answer)]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562832
There were no error_page context setttings for each context (found that on this forum with another recommendation from Bob). Once I added those the spiking appears to have stopped. Will see how it goes the next few days.

]]>
rx2 Nov 19, 2018, 08:40 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562832
<![CDATA[Re: Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562830 Quote from: BobRay at Nov 19, 2018, 05:45 PM
I haven't encountered that, but I wonder if you've got some kind of circular routing that's bouncing back and forth between http and https as you navigate the site and instantiating MODX at each iteration.

The server logs might tell you something about what's happening.

Thanks. Have been looking through the logs but it just seems like normal traffic with only very few robots bothering with https: (at least according the ssl log). Added a date_timezone setting and the home pages of each non "web" context seemed to render faster but the server CPU still shot up to 44%. The templates for each of these other site's home page is almost straight HTML as well. It's very confusing.]]>
rx2 Nov 19, 2018, 06:01 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562830
<![CDATA[Re: Moved to New Host (A2): Contexts that are not "web" spike Server CPU/Memory as does manager using non-web context URL]]> https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562828
The server logs might tell you something about what's happening.]]>
BobRay Nov 19, 2018, 05:45 PM https://forums.modx.com/thread/104646/moved-to-new-host-a2-contexts-that-are-not-web-spike-server-cpu-memory-as-does-manager-using-non-web-context-url#dis-post-562828