Search timeout.

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
NomadThanatos
Registered User
Posts: 5
Joined: Fri Jun 09, 2017 12:16 pm

Search timeout.

Post by NomadThanatos »

My forums search for some keywords will be timeout.

Timeout result
https://frt-eve.com/search.php?keywords=bilibili
https://frt-eve.com/search.php?keywords=Discord
...

Normal result
https://frt-eve.com/search.php?keywords=bilibi => for empty result
https://frt-eve.com/search.php?keywords=EVE => for non-empty result
...

First I checked the nginx log.
And I found the reason I got 500 error is timeout.

Code: Select all

2017/09/18 23:34:04 [error] 3092#0: *1028 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/phpBB3/vendor/symfony/polyfill-mbstring/Mbstring.php on line 420" while reading response header from upstream, client: 108.234.23.251, server: frt-eve.com, request: "GET /search.php?keywords=bilibili HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "frt-eve.com"
2017/09/18 23:36:31 [error] 3092#0: *1070 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/phpBB3/vendor/symfony/polyfill-mbstring/Mbstring.php on line 420" while reading response header from upstream, client: 108.234.23.251, server: frt-eve.com, request: "GET /search.php?keywords=Discord HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "frt-eve.com"
Then I thought it might becasue the phpbb Native Fulltext is slow, so I swtich to Sphinx fulltext.
And I checked the sphinx log, found that it is pretty fast but I still get above timeout in nginx log.

Code: Select all

[Mon Sep 18 23:36:01.689 2017] 0.000 sec 0.000 sec [ext/2/attr- 5 (0,10)] [index_phpbb_c8d2e104f270c3ce_delta;index_phpbb_c8d2e104f270c3ce_main] Discord
[Mon Sep 18 23:37:55.110 2017] 0.000 sec 0.000 sec [ext/2/attr- 19 (0,10)] [index_phpbb_c8d2e104f270c3ce_delta;index_phpbb_c8d2e104f270c3ce_main] bilibili
[Mon Sep 18 23:39:58.211 2017] 0.000 sec 0.000 sec [ext/2/attr- 0 (0,10)] [index_phpbb_c8d2e104f270c3ce_delta;index_phpbb_c8d2e104f270c3ce_main] bilibi
[Mon Sep 18 23:50:44.451 2017] 0.000 sec 0.000 sec [ext/3/attr- 261 (0,10)] [index_phpbb_c8d2e104f270c3ce_delta;index_phpbb_c8d2e104f270c3ce_main] EVE
:shock:
Thanks in advance!
NomadThanatos
Registered User
Posts: 5
Joined: Fri Jun 09, 2017 12:16 pm

Re: Search timeout.

Post by NomadThanatos »

BUMP...
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Search timeout.

Post by RMcGirr83 »

Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
NomadThanatos
Registered User
Posts: 5
Joined: Fri Jun 09, 2017 12:16 pm

Re: Search timeout.

Post by NomadThanatos »

Thanks for your reply.

I have tried to set to 300 secs and I still got timeout.
I am using Cloudflare CDN now so 300 secs would make CDN response 502.

I try to set to 90 secs.

Code: Select all

2017/09/23 22:16:14 [error] 18418#0: *50523 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 90 seconds exceeded in /var/www/html/phpBB3/vendor/symfony/polyfill-mbstring/Mbstring.php on line 420" while reading response header from upstream, client: 162.158.69.138, server: frt-eve.com, request: "GET /search.php?keywords=Discord HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "frt-eve.com", referrer: "https://www.phpbb.com/community/viewtopic.php?f=556&t=2439031"

Code: Select all

[Sat Sep 23 22:14:44.242 2017] 0.001 sec 0.001 sec [ext/2/attr- 5 (0,10)] [index_phpbb_c8d2e104f270c3ce_delta;index_phpbb_c8d2e104f270c3ce_main] Discord
My forums has 1k users and 1.5k posts now. I run it on a VPS.
I think there are not that much users and data, I am wondering why this is such slow...
Do others' forums search work well?
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3726
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Search timeout.

Post by Kailey »

NomadThanatos wrote: Sun Sep 24, 2017 2:45 am I am using Cloudflare CDN
Cloudflare has been known to cause problems with phpBB. Have you tried removing Cloudflare just as a test?
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
User avatar
Leinad4Mind
Translator
Posts: 863
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: Search timeout.

Post by Leinad4Mind »

In your case I would backup the search tables and then delete the index and re-index again.
I would start by that.
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
Explode!
Registered User
Posts: 50
Joined: Mon Nov 26, 2007 10:06 am

Re: Search timeout.

Post by Explode! »

Did you get to the bottom of this issue?

My board on 3.2 does it with exactly the same symptoms (500 server and execution timeout 30 or insert value here)
Maximum execution time of 30 seconds exceeded in /pathtoforum/vendor/symfony/polyfill-mbstring/Mbstring.php
This page isn’t working www.example.com is currently unable to handle this request.
HTTP ERROR 500
Most search terms work without incident just one specific has been reported so far.

Interestingly I've just found it happens when the search term is in single quotes but not when it's in double quotes, then it works..
Last edited by Explode! on Fri Aug 17, 2018 12:56 pm, edited 1 time in total.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26455
Joined: Fri Aug 29, 2008 9:49 am

Re: Search timeout.

Post by Mick »

Please start your own topic by filling out the Support Request Template and posting it your new topic to enable us to assist you better.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Explode!
Registered User
Posts: 50
Joined: Mon Nov 26, 2007 10:06 am

Re: Search timeout.

Post by Explode! »

Thanks, I'm not so worried about it, just thought if the OP had resolved it then it'd be useful to know how or why.

Since it seems to be related to the single quotes in my case, I'll just tell users not to do that and assume it's a bug.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Search timeout.

Post by Lumpy Burgertushie »

it is most likely caused by a setting of mod_security at the host level.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28616
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Search timeout.

Post by Paul »

Lumpy Burgertushie wrote: Fri Aug 17, 2018 5:03 pm it is most likely caused by a setting of mod_security at the host level.

robert
A php timeout can't be caused by mod security
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Search timeout.

Post by Lumpy Burgertushie »

however, 500 errors can and that is what the last poster said he was getting.

thanks,
robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28616
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Search timeout.

Post by Paul »

Lumpy Burgertushie wrote: Fri Aug 17, 2018 5:32 pm however, 500 errors can and that is what the last poster said he was getting.

thanks,
robert
No, he says he has the timeout together with the 500. I am also pretty certain mod security only gives 4xx errors, and not 5xx.
Big Monstro
Registered User
Posts: 59
Joined: Tue Nov 15, 2016 5:42 pm

Re: Search timeout.

Post by Big Monstro »

The topic author encountered timeout issue on vendor/symfony/polyfill-mbstring/Mbstring.php on line 420 when he/she used board search.

The problem is known and apparently existed since phpBB 3.2.0 (see https://tracker.phpbb.com/browse/PHPBB3-15043). I experienced myself on my own board with phpBB 3.2.2 and PHP 7.2 (not PHP 5.4 like the PHPBB3-15043 author), as well as with phpBB Native FullText as MySQL FullText.

Fortunately, the solution is quite simple : viewtopic.php?f=556&t=2466071&start=45#p14976516

You have to install mbstring PHP module! Although it's not stated (https://www.phpbb.com/support/docs/en/3.2/ug/), mbstring is an actual requirement for phpBB 3.2.x (before installing it, the board search can lasted up to five minutes per request for me, with one cpu core of my server loaded at 100% during this period. After installing mbstring, all the board search last only one second with a low level of cpu load).

I opened a ticket about that issue: https://tracker.phpbb.com/browse/PHPBB3-15754
Explode!
Registered User
Posts: 50
Joined: Mon Nov 26, 2007 10:06 am

Re: Search timeout.

Post by Explode! »

Big Monstro, this sounds like my issue, I'll give that a try and report back.
Post Reply

Return to “[3.2.x] Support Forum”