Closed zqhong closed 1 year ago
Once started, is the container still usage a lot of CPU ? It normal for the container to consume more CPU during startup...
thank you for your reply. CPU usage is normal after startup.
It's just that I look at the strace log, a lot of Bad file descriptor
is not normal in my opinion.
extra information:
# strace -Tt -p [pid]
11:16:01 open("/etc/machine-id", O_RDONLY|O_LARGEFILE) = 10 <0.000038>
11:16:01 fstat(10, {st_mode=S_IFREG|0644, st_size=33, ...}) = 0 <0.000006>
11:16:01 read(10, "3e0a555284ac4f2ebe42c5c279d07637"..., 33) = 33 <0.000012>
11:16:01 close(10) = 0 <0.000009>
11:16:01 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 <0.000006>
11:16:01 pipe([10, 11]) = 0 <0.000015>
11:16:01 pipe([12, 13]) = 0 <0.000012>
11:16:01 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [CHLD], 8) = 0 <0.000010>
11:16:01 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1 RT_2], 8) = 0 <0.000008>
11:16:01 fork() = 529 <0.000654>
11:16:01 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1 RT_2], NULL, 8) = 0 <0.000007>
11:16:01 rt_sigprocmask(SIG_SETMASK, [CHLD], NULL, 8) = 0 <0.000006>
11:16:01 close(11) = 0 <0.000006>
11:16:01 close(13) = 0 <0.000007>
# Note: a lot of time is spent here
11:16:01 read(10, "", 1024) = 0 <203.380721>
11:19:25 wait4(529, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 529 <0.000119>
11:19:25 read(12, "", 1024) = 0 <0.000010>
11:19:25 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 <0.000006>
11:19:25 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=529, si_uid=1000, si_status=1, si_utime=5900, si_stime=13938} ---
11:19:25 close(10) = 0 <0.000013>
11:19:25 close(12) = 0 <0.000008>
11:19:25 stat("/config/profile", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 <0.000011>
11:19:25 stat("/config/profile/.parentlock", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 <0.000008>
11:19:25 open("/config/profile/.parentlock", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 10 <0.000033>
11:19:25 fcntl(10, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0, l_len=0, l_pid=1566065899}) = 0 <0.000007>
11:19:25 fcntl(10, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0 <0.000007>
As you can see(11:16:01 read(10, "", 1024) = 0 <203.380721>
), there is a read function that took 203 seconds.
I assume the PID you are talking about is the one of Firefox ?
Note that this project is only packaging Firefox into a Docker container. I don't modify, adjust or fix the source code. If you think there is a problem with Firefox itself, you are probably better to report it directly to Mozilla. Also, you should be able to see the same behaviour with a "normal" Linux installation.
Basic Information:
My docker start command:
Firefox log:
Information obtained by
strace -p [pid]
: