I'm use Symfony2 into one critical application. For each client (each tab in browser is client) JS through AJAX request data each second. And folder /cache/dev/profiler/ grown really fast! 17Gb for 2 days! How can i disable this writing?
4 Answers
There is the option in config_dev.yml
framework:
profiler: { only_exceptions: true }
It was false, now all going normal.

- 1,574
- 4
- 22
- 36
-
2In symfony 4 this option is at `config/packages/dev/web_profiler.yaml` – Genarito Feb 22 '19 at 15:31
-
1What does changing this option actually change though? – Dan Oct 12 '21 at 09:54
Check to see if your environment is running in dev (development) mode, if so make sure it is on prod (production). In dev mode alot proccessing is done for debugging reasons and this is not needed for your clients.
if you wish to disable the profiler you can do it
In: app/config/config_dev.yml
web_profiler:
toolbar: true
only-exceptions: true
intercept_redirects: false

- 890
- 18
- 23
-
-
http://symfony.com/doc/master/book/internals.html#profiler there it is descripted – Neka Feb 18 '13 at 17:04
-
I see! Just a question why would you want to run in dev env while having clients on the site? – GiveMeAllYourCats Feb 18 '13 at 17:21
-
Because it manage clients on the router and used by technical specialists while I developing it. – Neka Feb 19 '13 at 01:47
Here is better solution, you can store your profiler data in redis thanks to SncRedisBundle, they have implemented profiler_storage.
They have also added TTL, so your profiler data can expire automatically.
First configure your snc_redis client in config.yml
snc_redis:
clients:
default:
type: predis
alias: default
dsn: redis://localhost
Then add profiler storage in config_dev.yml
snc_redis:
profiler_storage:
client: default
ttl: 86400

- 3,874
- 3
- 32
- 35
-
That is a really good solution for projects using Redis and SncRedisBundle! – Najki Oct 15 '19 at 09:50
-
@Najki yep, since I use the redis method I don't have problems anymore. – nacholibre Oct 15 '19 at 12:05
my solution
* * * * * root cd /path/to/project/src/var/cache/dev/profiler && sed -i ':a;$q;N;101,$D;ba' ./index.csv && ls -1t | tail -n +102 | xargs rm -rf
where:
sed -i ':a;$q;N;101,$D;ba' ./index.csv
removes all lines in index.csv, except last 100. (new dumps are stored last)
ls -1t | tail -n +102 | xargs rm -rf
removes all folders and files except newest 100 by modification date.
102 - to account for index.csv

- 23
- 1
- 5