silverstripe-framework/docs/en/02_Developer_Guides/08_Performance/05_Resource_Usage.md
Aaron Carlino 6888901468
NEW: Update docs to be compliant with Gatsby site (#9314)
* First cut

* Temporarily disable composer.json for netlify build

* POC

* New recursive directory query, various refinements

* Fix flexbox

* new styled components plugin

* Apply frontmatter delimiters

* Mobile styles, animation

* Search

* Redesign, clean up

* Nuke the cache, try again

* fix file casing

* Remove production env file

* ID headers

* Move app to new repo

* Add frontmatter universally

* Hide children changelogs

* Add how to title

* New callout tags

* Revert inline code block change

* Replace note callouts

* Fix icons

* Repalce images

* Fix icon

* Fix image links

* Use proper SQL icon
2019-11-18 17:58:33 +13:00

1.3 KiB

title summary icon
Resource Usage Manage SilverStripe's memory footprint and CPU usage. tachometer-alt

Resource Usage

SilverStripe tries to keep its resource usage within the documented limits (see the server requirements).

These limits are defined through memory_limit and max_execution_time in the PHP configuration. They can be overwritten through ini_set(), unless PHP is running with the Suhoshin Patches or in "safe mode".

[alert] Most shared hosting providers will have maximum values that can't be altered. [/alert]

For certain tasks like synchronizing a large assets/ folder with all file and folder entries in the database, more resources are required temporarily. In general, we recommend running resource intensive tasks through the command line, where configuration defaults for these settings are higher or even unlimited.

[info] SilverStripe can request more resources through Environment::increaseMemoryLimitTo() and Environment::increaseTimeLimitTo() functions. [/info]

use SilverStripe\Core\Environment;

public function myBigFunction() 
{
    Environment::increaseTimeLimitTo(400);
}