Comments (9)
Not 100% sure it will help but I just added logic to run the browser in a separate session and kill all processes in the session when cleaning up.
from webpagetest.agent.
Thank you, I test it when a new release will be pushed on dockerhub : https://hub.docker.com/r/webpagetest/agent/
from webpagetest.agent.
That's bizarre. dockerhub is supposed to build on every push but it looks like it got wedged a month ago. Poking at it now to see what is going on.
from webpagetest.agent.
ok, new build looks like it went through
from webpagetest.agent.
I try with latest version and I still have the problem.
root 9660 9596 11 09:55 ? 00:00:46 python /wptagent/wptagent.py --server http://webpagetest/work/ --location agent1 --name Docker Test --key key1 --xvfb --dockerized
root 9977 9660 2 09:55 ? 00:00:08 Xvfb :1597771276 -screen 0 1920x1200x24
root 10886 9660 0 09:55 ? 00:00:00 [chrome] <defunct>
root 10887 9660 0 09:55 ? 00:00:00 [nacl_helper] <defunct>
root 11184 9660 0 09:55 ? 00:00:02 [chrome] <defunct>
root 11489 9660 0 09:55 ? 00:00:00 [chrome] <defunct>
root 11490 9660 0 09:55 ? 00:00:00 [nacl_helper] <defunct>
root 11730 9660 0 09:55 ? 00:00:01 [chrome] <defunct>
root 11999 9660 0 09:55 ? 00:00:00 [chrome] <defunct>
root 12000 9660 0 09:55 ? 00:00:00 [nacl_helper] <defunct>
from webpagetest.agent.
Same here. Running four docker wptagent instances this sums up to about 5000 processes in 2 days (alternating firefox and dbus processes). While these don't consume significant ressources, this can lead to several other problems, apart from breaking the monitoring of the server (normally I monitor the processes on the server to be alarmed im something spawns endlessly). Running on the newest bundled WPT release (17.12).
Any clues?
Snippet from ps ax:
26450 ? Z 0:00 [gconfd-2] <defunct>
26455 ? Z 0:00 [Web Content]
26527 ? Z 0:00 [dbus-launch] <defunct>
26528 ? Zs 0:00 [dbus-daemon]
26531 ? Z 0:00 [dbus-launch] <defunct>
26532 ? Zs 0:00 [dbus-daemon]
26534 ? Z 0:00 [gconfd-2] <defunct>
26543 ? Z 0:00 [dbus-launch]
26544 ? Zs 0:00 [dbus-daemon] <defunct>
26547 ? Z 0:00 [gconfd-2]
26565 ? Z 0:00 [Web Content] <defunct>
26578 ? Z 0:00 [gconfd-2]
26627 ? Z 0:00 [firefox] <defunct>
from webpagetest.agent.
Actually, the docker conecpt just seems to miss some proper cleanup, especially when looking at the potential number (and frequency) of spwaned processes from within. This was a topic at the docker community some time ago (long story short: transferring PID 1 if there is no init system built into the docker instance itself).
Adding --init
to the docker run command fixes this problem. In it's simplest form:
docker run -d --rm --init -e SERVER_URL="https://example/work/" -e LOCATION="Coolest_Location" -e NAME="Coolest_Agent" wptagent
Edit: I should note that this requires at least docker version >=1.13, if you're on a lower version you should look into some external solutions like https://github.com/Yelp/dumb-init
from webpagetest.agent.
--init
option is not available to containers running in kubernetes. is there another way to avoid defunct chrome processes?
from webpagetest.agent.
after a bit googling and reading, this https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/#understanding-process-namespace-sharing seems to resolve the issue in kubernetes containers. The container process no longer has PID 1
bit is the key as the termination of chrome processes failed, if agent startup script was assigned pid 1. hope this helps others. :)
from webpagetest.agent.
Related Issues (20)
- CWV element extraction script accidentally trips Chrome feature usage flags
- Issue with HTTP/2 Redirect reporting HOT 1
- Updates to release tags
- Explore migration to Ubuntu 22.04 HOT 10
- Missing critical information (e.g. how to start it, how configure it post install)
- webpagetest Test Error: Error configuring traffic-shaping on ubuntu 18.04 HOT 1
- Not able to start webpagetest agent on redhat 8.0
- Add support for Soft Navigation HOT 4
- Visual-complete progress bug
- Can the image run without CAP_NET_ADMIN
- Not able to run tests on Chrome 112 HOT 1
- Not able to reset executionContext HOT 1
- Chrome v114 slowdowns due to enabling Debugger in dev tools
- Not able to set the executionContext using Id of iframe HOT 8
- Dockerfile is missing text file for apt-get HOT 2
- How to get LCP and FCP metrics on running a private instance.?? HOT 1
- Error: NaCl helper process running without a sandbox!
- Sign-in is successful but the step returns Error: 404 and stops
- combineSteps Command of Script is not working on giving count
- Empty test result, only orange start_page HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webpagetest.agent.