XF 2.3 localhost set to persistent in config.php - ok or not?

Alvin63

Well-known member
Licensed customer
Had some messy issues this week. I was uploading some smilies in acp. Maybe did a bit too much trying different versions, deleting and re-uploading, and the site had a 403 forbidden error everywhere. It was back on in a few minutes. Server bot said it had flushed the server cache. But it left me with a messed up forum and database errors every few minutes. I opened a ticket a few days ago but think it's solved now.

It was a server side issue. So I repaired and optimised the database tables to resolve any corrupted cache's etc (as I was advised was probably what was causing too many requests since the 403). And Server said to add p: in front of localhost in config.php to avoid that happening again, because there is a limit of 20 new connections per second. Asked if that could be increased and they said no it's fixed for shared hosting.

So I have done that - changed localhost to p:localhost. Forum is back to normal again and no more server errors or Oops database errors every time someone posted.

But I'm not too happy about having had to make it persistent. I don't really understand that. So what do people think? Could it cause other issues?

I'm half thinking now of just not making it persistent now the issue is solved. I'd been running the site for nearly 4 years without any kind of issue like this. And I won't be uploading any more smilies via acp.

So should I leave it as persistent or remove p: again?
 
Had some messy issues this week. I was uploading some smilies in acp. Maybe did a bit too much trying different versions, deleting and re-uploading, and the site had a 403 forbidden error everywhere. It was back on in a few minutes. Server bot said it had flushed the server cache. But it left me with a messed up forum and database errors every few minutes. I opened a ticket a few days ago but think it's solved now.

It was a server side issue. So I repaired and optimised the database tables to resolve any corrupted cache's etc (as I was advised was probably what was causing too many requests since the 403). And Server said to add p: in front of localhost in config.php to avoid that happening again, because there is a limit of 20 new connections per second. Asked if that could be increased and they said no it's fixed for shared hosting.

So I have done that - changed localhost to p:localhost. Forum is back to normal again and no more server errors or Oops database errors every time someone posted.

But I'm not too happy about having had to make it persistent. I don't really understand that. So what do people think? Could it cause other issues?

I'm half thinking now of just not making it persistent now the issue is solved. I'd been running the site for nearly 4 years without any kind of issue like this. And I won't be uploading any more smilies via acp.

So should I leave it as persistent or remove p: again?
Every time you upload, delete or test a smilie, XenForo wipes and rebuilds the cache. It seems your hosting blocked access to protect itself (403 error) and because it cut things off midtask, you ended up with corrupted temp data and those db errors.

The p: fixed the crash because it makes php reuse open database connections instead of opening a new one per request but you also should be aware that persistent connections sometimes lead to dead sockets so I'd recommend to remove it. Also if there is a traffic bump it'll eat your total connection allowance.
 
Thank you. That has confirmed what I thought. I'll remove it. Am thinking of switching to a different server that won't do a hard 403 in that situation.
 
Thank you. That has confirmed what I thought. I'll remove it. Am thinking of switching to a different server that won't do a hard 403 in that situation.
If you're open to exploring better hosting options, we can set you up with 30 days free on our hosting so you can see the difference firsthand. No CC required.
 
Well I turned persistance off and started getting the odd server error again. Operation not permitted. But I'm in the process of migrating to a different server.
 
Just to update, moved the site to Krystal. As soon as Cloudflare was pointed to the new server, did a master data rebuild, and everything is stable and back to normal. Google AI told me Krystal works in a different way, doesn't have a hard cap like my previous server, and if there were excessive requests it would slow things down rather than do a 403 forbidden. Whether that is correct is another matter!

When looking at all server plan details - storage, ram inodes etc, nowhere do these places advertise limits of 20 connections per second etc! So I guess you have to go with reputation.

So if anyone else is on cheap (or even not so cheap) shared hosting, I'd suggest being cautious with uploading and deleting smilies via ACP! @Mr Lucky mentioned there's a way to upload them direct to the server instead.
 
Last edited:
Back
Top Bottom