HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Where to Increase set_time_limit() (max_execution_time)

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#111274 (In Topic #22355)
TQ
Avatar

Honoured member

I did a search on my site and got an error message stating the the search had exceeded the 5 second execution time. When repeated it was fine and found 753 results.

This occurred whilst the server was under load from an AV scan and a bunch of other things going on.

max_execution_time is currently set to 30 seconds in php.ini so I'm assuming that set_time_limit() in invoked somewhere in ocP.

Would it be ok to say double this to 10 seconds and if yes, where is it located?

Thanks as always.

TQ
Back to the top
 
Posted
Rating:
#111277
Avatar

Right. The way the time limit works is it applies from when it is set. We have this line in site/pages/modules/database_search.php that gives each search hook 5 seconds:

Code

if (function_exists('set_time_limit')) @set_time_limit(5); // Prevent errant search hooks (easily written!) taking down a server. Each call given 5 seconds (calling set_time_limit resets the timer).

You could try raising that number.

Search in v10+ is typical faster because we've eliminated the translate table for most people, which makes MySQL searching much more straight-forward.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#111278
TQ
Avatar

Honoured member

Well, how strange is that! I don't have a database_search.php in site/pages/modules/

I do have one in /sources/ but that doesn't contain the code you mention.

That's confusing ...

TQ
Back to the top
 
Posted
Rating:
#111279
Avatar

My bad:
site/pages/modules/search.php


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#111280
TQ
Avatar

Honoured member

Thanks Chris, much appreciated.

TQ


Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: