I've "inherited" an ezPublish server running 5.1, with 4.7 legacy as well. Whenever an admin goes to Setup and clears the caches, it regenerates all of the images (thousands of them) in a variety of sizes -- this takes hours, during which the server load is so high, it's down for all practical purposes.
My questions are:
Thank you in advance.
the legacy-stack stores the generated image-alias in the database. Before generating the actual file this table is checked. Clearing the image-cache will truncate this table or set all images to expired.
If the file is mentioned/active in the database, it will be used. Otherwise it will be generated with convert.
The symfony-stack on the other hand will actually check if the file exists (therefor the cache is not being cleared).
Suggestion on clearing the cache: When going to /setup/cache and check out "Fine-grained cache control". Check all boxes and uncheck "Image alias". This will clear everything but the images itself. Convert won't run rampage on your server after this.
You might also want to add a custom-view to get this to a more convenient place.
Important: Never clear the image-cache except if you REALLY need it. The mentioned behaviour is normal (as mentioned before).
On the second question: Check out http://cpulimit.sourceforge.net/ to limit the all system-threads based on "convert". This should help.