WebDev

Webdevelop => Site Discussion => Topic started by: Dave on March 07, 2026, 02:15:48 AM

Title: Site's slow to connect
Post by: Dave on March 07, 2026, 02:15:48 AM
Hi Chen,

For some reason the last 2 days the site has been very slow to connect. This morning I got

QuoteThis site can't be reached
web-develop.ca took too long to respond

it obviously did eventually connect as I'm posting this message
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 08, 2026, 01:15:48 AM

Yes something is up that I'll have to figure out.
There are no errors in the SMF log but I'll check out the server logs to see if it shows any problems.
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 08, 2026, 03:53:03 AM

I'm not sure just yet but it might be due to a PHP FPM misconfiguration.
Some adjustments have been applied which will hopefully fix the issue.

Thanks for the report. 
Title: Re: Site's slow to connect
Post by: Dave on March 08, 2026, 04:23:23 AM
It's a lot quicker now Chen
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 08, 2026, 01:44:40 PM

There was also an update to the SMF main package that has fixes in it regarding the mail queue and PHP sessions which has been applied.
It may or may not be related because I did have a misconfiguration regarding sessions that I adjusted.

I am using memcached for sessions within SMF settings but my PHP-FPM configuration was not set properly for it and had to be adjusted.
Hopefully this issue is now resolved.   
Title: Re: Site's slow to connect
Post by: Dave on March 08, 2026, 06:18:03 PM
Quote from: Chen Zhen on March 08, 2026, 01:44:40 PMThere was also an update to the SMF main package that has fixes in it regarding the mail queue and PHP sessions which has been applied.
It may or may not be related because I did have a misconfiguration regarding sessions that I adjusted.

I am using memcached for sessions within SMF settings but my PHP-FPM configuration was not set properly for it and had to be adjusted.
Hopefully this issue is now resolved.   

I was just going to do a post about that, just as a reminder that if you did the 'ScheduledTasks.php' edit for the emails to reverse that before you update.
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 21, 2026, 12:04:41 AM
The session fix seems to be working good now and the other thing you reported in the shoutbox seems to be from some sort of brute force bot attack.

It seems my site was targeted by some sort of script that bombards the server with querying files (non-existent) that was forcing PHP-FPM to handle the errors which was overwhelming it. 2 IP's were mostly involved so I blocked them but that won't stop it from happening again.

I didn't realize until I looked into it that it's best to configure Apache to handle those type of errors instead of leaving it up to PHP. I had to make some adjustments in my Apache configuration file.

ref. php-fpm ProxyErrorOverride on (https://www.google.com/search?q=php-fpm+ProxyErrorOverride+on&rlz=1C1QCTP_enCA1115CA1115&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCTM4MjRqMGoxNagCCLACAQ&sourceid=chrome&ie=UTF-8&udm=50&fbs=ADc_l-aN0CWEZBOHjofHoaMMDiKpmAsnXCN5UBx17opt8eaTX-kA7ovRmAIYWC70eULDzbpnQTYs94Mq8g6LHC3WhbQO7M01KHLtT-pJxbMt2v0OUBW1zQ8A4b84zIk6DdkDrl95LrXHYaQp11OT-Fhvxp8VLEzSX4k7jB4p-HIRk3LabZe8-LRdMzu7JhDvhnTeNEmNg4VxBHXCZqZR1B14CV0Y4EQ4ZQ&ved=2ahUKEwjTt4P5hrCTAxUhkokEHd8RMNgQ0NsOegQIAxAB&aep=10&ntc=1&mstk=AUtExfAMRdvkFVrewVQooULcT41gUpm3CNEpsR67KWYt8HJLRbmA5vCkERvnPoxggznkSmODdxp6O5RkHJ0SIMu_c3WGcCpwjOzK2nHBqzlPdVKX6O4-HSwcF-3uc1vKMxFLmDlLJsAGGQEZDgpEQVF-lLTb_U6PYdVVW6JGR7nYBoAQRL4dhMVDehwu0FQVwglCMKk9H-2gRtZIncE9PN_ImXNTNgZ3D--PfAb_rPRD1Ac8dV5Pkj6ydOSFpUQM-OUemp0Ms4cEYGapIJrtWmLB5Lo5fNMukgU-tpCl8YkoUjiwiozKNYuTVfjxMTbToJMf0oq6QPfjDU1KHw&csuir=1&mtid=gBG-afPbL_2qptQPu8XGsA8)

I also added a custom error page while I was at it.
At one time I used to have an assortment of custom error pages but must have neglected to include them at some point.
Title: Re: Site's slow to connect
Post by: Dave on March 21, 2026, 03:13:31 AM
Thanks for the info. At you know now I wasn't seeing things  ;)
Title: Re: Site's slow to connect
Post by: Skhilled on March 25, 2026, 06:07:22 PM
Quote from: Chen Zhen on March 21, 2026, 12:04:41 AMThe session fix seems to be working good now and the other thing you reported in the shoutbox seems to be from some sort of brute force bot attack.

It seems my site was targeted by some sort of script that bombards the server with querying files (non-existent) that was forcing PHP-FPM to handle the errors which was overwhelming it. 2 IP's were mostly involved so I blocked them but that won't stop it from happening again.

I didn't realize until I looked into it that it's best to configure Apache to handle those type of errors instead of leaving it up to PHP. I had to make some adjustments in my Apache configuration file.

ref. php-fpm ProxyErrorOverride on (https://www.google.com/search?q=php-fpm+ProxyErrorOverride+on&rlz=1C1QCTP_enCA1115CA1115&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCTM4MjRqMGoxNagCCLACAQ&sourceid=chrome&ie=UTF-8&udm=50&fbs=ADc_l-aN0CWEZBOHjofHoaMMDiKpmAsnXCN5UBx17opt8eaTX-kA7ovRmAIYWC70eULDzbpnQTYs94Mq8g6LHC3WhbQO7M01KHLtT-pJxbMt2v0OUBW1zQ8A4b84zIk6DdkDrl95LrXHYaQp11OT-Fhvxp8VLEzSX4k7jB4p-HIRk3LabZe8-LRdMzu7JhDvhnTeNEmNg4VxBHXCZqZR1B14CV0Y4EQ4ZQ&ved=2ahUKEwjTt4P5hrCTAxUhkokEHd8RMNgQ0NsOegQIAxAB&aep=10&ntc=1&mstk=AUtExfAMRdvkFVrewVQooULcT41gUpm3CNEpsR67KWYt8HJLRbmA5vCkERvnPoxggznkSmODdxp6O5RkHJ0SIMu_c3WGcCpwjOzK2nHBqzlPdVKX6O4-HSwcF-3uc1vKMxFLmDlLJsAGGQEZDgpEQVF-lLTb_U6PYdVVW6JGR7nYBoAQRL4dhMVDehwu0FQVwglCMKk9H-2gRtZIncE9PN_ImXNTNgZ3D--PfAb_rPRD1Ac8dV5Pkj6ydOSFpUQM-OUemp0Ms4cEYGapIJrtWmLB5Lo5fNMukgU-tpCl8YkoUjiwiozKNYuTVfjxMTbToJMf0oq6QPfjDU1KHw&csuir=1&mtid=gBG-afPbL_2qptQPu8XGsA8)

I also added a custom error page while I was at it.
At one time I used to have an assortment of custom error pages but must have neglected to include them at some point.

When I click that link I get:

QuoteSomething went wrong and an AI response wasn't generated.

Even when I'm logged in I get the same.
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 25, 2026, 11:29:22 PM
That's odd because the link works fine for me.

Just use the google search engine and type "php-fpm ProxyErrorOverride on" in the search input.
It should bring up the AI response which you can click on.

Assuming you are using PHP-FPM...
The example shown has a generic path for the socket, you'll have to find where the "SetHandler" line is in your Apache config file and add "ProxyErrorOverride On" after it. There is a second option below it for adding a condition instead which I will try if the first example causes any problems.
Title: Re: Site's slow to connect
Post by: Dave on March 26, 2026, 03:39:34 AM
It did the same for me too

Something went wrong and an AI response wasn't generated.
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 27, 2026, 07:00:11 PM
IMO it's strange behavior.. perhaps something to do with region restrictions?
If you're curious, you can try using a proxy or VPN that spoofs a Canadian IP to see if it works.
This has got me curious.. I may try spoofing the US or UK to see if it doesn't work.
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 27, 2026, 07:11:40 PM
My firewall is blocking the use of any VPN or online proxy..
I might try a plug-in but in a browser that I don't normally use because I don't like 3rd party stuff filtering sensitive data (ie. bank, government sites, etc.).

Here is a stackoverflow link that more or less contains the same information:
https://stackoverflow.com/questions/25801695/apache-2-4-php-fpm-catching-error-pages
Title: Re: Site's slow to connect
Post by: Dave on March 28, 2026, 03:48:37 AM
I've set my VPN to Canada and clicked on your link but it ends up with the same result as my previous post.

However I think it might be to do with the fact that your link is Google based. So what I did was copy the text of the link and then pasted that into my browser address bar and the result was as per the attached.

I'm not sure if that's the response you expected from your original link or not
Title: Re: Site's slow to connect
Post by: Chen Zhen on March 28, 2026, 07:29:25 PM
That's the second example in what I posted.
I used the ProxyErrorOverride option but might change it to what you just posted. Don't forget that it's just the condition that is applied because the socket path will be different.
One just needs to surround the SetHandler path with the condition.
Title: Re: Site's slow to connect
Post by: Dave on March 29, 2026, 03:50:37 AM
Quote from: Chen Zhen on March 28, 2026, 07:29:25 PMDon't forget that it's just the condition that is applied because the socket path will be different.

I don't understand any of it Chen it's way above my comprehension, all I was doing was trying to see if the link you posted was what I found   :D
EhPortal 1.40.4-RC1 © 2026, WebDev