sitespeed.io icon indicating copy to clipboard operation
sitespeed.io copied to clipboard

Running sitespeed test in pods, after few hours the pods go down

Open mdvaliyullah opened this issue 1 year ago • 12 comments

Your question

Hi Team,

while running sitespeed tests in pods, I observed that memory usages increases continuously and the tests were scheduled to run every 15 minutes, after few hours the pods go down, we set up the --max-old-space-size to 8GB but still the pod goes down once it reached the threshold. please advise

Thanks, Valiyullah

mdvaliyullah avatar Feb 21 '24 16:02 mdvaliyullah

I assume you are running continually in the same pod; consider using a cronjob to run your tests so the control plane spins up a new pod for each schedule.

madan avatar Feb 21 '24 17:02 madan

Hi @mdvaliyullah can you share more on how you run? I'm thinking maybe there could be some tweak in how we handle memory that could be done. Else as @madan said, starting a new container every time is good.

For long running containers (over days) I've think I have work todo to cleanup Chrome issues, I've seen tmp files etc that probably should be cleaned, but my use case has always been to spin up a new container.

soulgalore avatar Feb 21 '24 18:02 soulgalore

Hi @soulgalore my use case is to run different urls list during each schedule, so i wanted to keep the container running for long period, is there way to clean up the unused memory after each run?

mdvaliyullah avatar Feb 21 '24 18:02 mdvaliyullah

Ok, so the size of the container meets the limits is reached or what happens? As long as the NodeJs process is exited, the only thing that should be in the conainer are the result files like html/videos etc. Are they removed in your current setup?

soulgalore avatar Feb 21 '24 19:02 soulgalore

Yes results folders are cleaned up before starting a new test, once the memory reaches the heap limits the pod get restarted

mdvaliyullah avatar Feb 21 '24 19:02 mdvaliyullah

Ok, so do you have your own container or have you overridden the start script or how do you do it, can you share a little more?

soulgalore avatar Feb 21 '24 21:02 soulgalore

I have own container with sitespeed image. No changes to startup script, just passing the arguments details like url list, iteration when starting the test to the script.

mdvaliyullah avatar Feb 22 '24 02:02 mdvaliyullah

Ok. How does it work, how do you keep the container open, isn't closed after a test run?

soulgalore avatar Feb 22 '24 12:02 soulgalore

Yes it is not closed after the test run, the sitespeed image is used as a base image in the container

mdvaliyullah avatar Feb 22 '24 14:02 mdvaliyullah

But you exit node? So like for each test you run, you run the start script? Do you have anything setup to monitor the memory usage, is it constant increasing?

soulgalore avatar Feb 22 '24 17:02 soulgalore

Yes, I checked there is no process running once the test completes. I run the start script for every test once the previously running test completes. memory usage gradually increases for each test once it reaches the usage threshold the pods gets restarted.

mdvaliyullah avatar Feb 22 '24 17:02 mdvaliyullah

Ok, can you get more granularity to see what uses the memory? Since you use your own container, do you have something else running in it?

soulgalore avatar Feb 28 '24 16:02 soulgalore