0

I have a PHP script running in browser, it runs for a while then ends up with Service Unavailable

Running top shows a php-fpm process pegging the CPU near 100%, strace shows an infinite loop of:

mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4549600000

Any idea what's going on here?

chx
  • 11,270
  • 7
  • 55
  • 129
  • Does this answer your question? [php-fpm7.1 mmap/munmap (very) slow performance on virtualized systems (hugepage)](https://stackoverflow.com/questions/45013646/php-fpm7-1-mmap-munmap-very-slow-performance-on-virtualized-systems-hugepage) – emptyhua Nov 01 '21 at 05:55
  • Nope. Not at all. That's a performance problem with mmap/munmap/madvise. This is an infinite loop with mmap only. Typical Stackoverflow. – chx Nov 01 '21 at 06:37
  • @emptyhua now check my answer. Don't be so hasty on closing questions. – chx Nov 01 '21 at 22:53
  • I did not see the PHP code, so I can only infer from the error message. – emptyhua Nov 01 '21 at 23:12
  • @emptyhua which, again, has _nothing_ to do with that question except for a mmap call. Significant differences include a) lack of other calls b) erroring out instead of being slow. I am trying to educate you here so others will have a better SO experience. – chx Nov 02 '21 at 03:51

1 Answers1

0

This turned out to be a userspace infinite recursion and the mmap calls were allocating stack space.

chx
  • 11,270
  • 7
  • 55
  • 129