1

I followed this link https://nodejs.org/uk/docs/guides/simple-profiling/, to profile a particular endPoint in my app (Expressjs).

The endpoint will download a pdf from s3 , use a thread pool ( a pool of 4 worker_threads) to fill the pdf with data (I use HummusJS for pdf filling), then upload the filled file to s3 and respond with a signedUrl for the filled file.

The test was done by apache benchmark:

ab -p req.json -T application/json -c 20 -n 2000 http://{endpoint}

The output from profilling was like this :

 [Bottom up (heavy) profile]:
  Note: percentage shows a share of a particular caller in the total
  amount of its parent calls.
  Callers occupying less than 1.0% are not shown.

   ticks parent  name
  287597   89.2%  epoll_pwait
 [Bottom up (heavy) profile]:
  Note: percentage shows a share of a particular caller in the total
  amount of its parent calls.
  Callers occupying less than 1.0% are not shown.

   ticks parent  name
  1515166   98.5%  epoll_wait

So, my question is , what does the epoll_wait and epoll_pwait mean, since they are taking almost 100% of CPU time taken by the program ?

Mu-Majid
  • 851
  • 1
  • 9
  • 16

1 Answers1

1

See google.com/search?q=epoll_wait.

In short, the thread was waiting for something (maybe the network? maybe another thread?).

jmrk
  • 34,271
  • 7
  • 59
  • 74