Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP command line app is very slow (stat syscall suspected) #2060

Closed
chx opened this issue May 5, 2017 · 3 comments
Closed

PHP command line app is very slow (stat syscall suspected) #2060

chx opened this issue May 5, 2017 · 3 comments

Comments

@chx
Copy link

chx commented May 5, 2017

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Version 10.0.15063. lsb_release -a reports Ubuntu 16.04.2 LTS.

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

I am running a PHP command line application.

  • What's wrong / what should be happening instead:

It's slow as molasses.

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)

It's not failing, it's just slooooow. I'd rather not post the whole thing, I sorted out the syscalls for you: 1984 read, 2043 mmap, 4182 access, 8541 open, 8643 close, 12291 fstat, 12990 getdents, 57261 stat, 66285 lstat calls, the entire syslog is 191371 lines long (if you need the whole log, email me chx1975 gmail and I will send it over). Yeah, that's a lot but then again I have an SSD and 24GB of RAM and the Xeon E3 equivalent of an i7 2600 so I expect it to be quite fast which on Linux it is. Perhaps the results of {l,f,}stat is not cached...? There are only 11917 files in the entire tree. How can I help? I am an expert in PHP and if badly pushed, I can use gdb :) (I wrote the answer on SO on how to use them together. That was hard.)

On a whole another note, mongodb is slow as well. Should I file a separate issue?

@chx chx changed the title stat/fstat/lstat syscall is very slow PHP command line app is very slow May 5, 2017
@chx chx changed the title PHP command line app is very slow PHP command line app is very slow (stat syscall suspected) May 5, 2017
@therealkenc
Copy link
Collaborator

#1305 (message) #981 and friends. User voice is here.

@chx
Copy link
Author

chx commented May 7, 2017

But that's git and seeking? Or is it the same issue?

@therealkenc
Copy link
Collaborator

therealkenc commented May 7, 2017

Seek in the issue title was just speculation by the OP. The problem with rsync, git, and (most likely) your PHP script is they crap all over stat()/lstat(), which is not handled well per the message I linked. getdents() is probably bad too because Windows doesn't really have dents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants