Need pointer to explain CPU usage

Hello List, I have a tiny scotty-based application, which when compiled and started in profiling mode, consumes 10x CPU it does in normal mode. Interestingly, if I fire a request on the app, CPU usage drops to minimal after finishing the request for a while. But after a few minutes it starts consuming 10x CPU again. First I would have suspected scotty, however collecting time profiling info with -p, -P or -Pa doesn't reveal much. That still not rules scotty out however. To make matters worse, I inspect strange time profiling tick count I can't explain - the .prof file says "2 ticks @ 1000 us", while the application was clearly running idle for a good few seconds. Any ideas what am I missing? Thanks, Robin

Could it be idle time garbage collection [0]? You can try turning it
off with '+RTS -I0'.
Erik
[0] http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/runtime-control.html#...
On Wed, May 7, 2014 at 9:43 PM, Robin Palotai
Hello List,
I have a tiny scotty-based application, which when compiled and started in profiling mode, consumes 10x CPU it does in normal mode.
Interestingly, if I fire a request on the app, CPU usage drops to minimal after finishing the request for a while. But after a few minutes it starts consuming 10x CPU again.
First I would have suspected scotty, however collecting time profiling info with -p, -P or -Pa doesn't reveal much. That still not rules scotty out however.
To make matters worse, I inspect strange time profiling tick count I can't explain - the .prof file says "2 ticks @ 1000 us", while the application was clearly running idle for a good few seconds.
Any ideas what am I missing?
Thanks, Robin _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Erik: I tried -I0 in the mean time, without effect.
By the way it is GHC 7.6.3, flags are -threaded -rtsopts -O2 -caf-all
-auto-all, runtime flags are +RTS -N -I0.
Also, recent runs didn't show the behavior where CPU would go to zero
after serving a request (goes back to 10% immediately after
finishing), but this is a bit flaky.
If I decrease the base tick rate with -V0.01, the CPU usage is lower -
not sure if that is indicative.
2014-05-08 8:35 GMT+02:00 Erik Hesselink
Could it be idle time garbage collection [0]? You can try turning it off with '+RTS -I0'.
Erik
[0] http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/runtime-control.html#...
On Wed, May 7, 2014 at 9:43 PM, Robin Palotai
wrote: Hello List,
I have a tiny scotty-based application, which when compiled and started in profiling mode, consumes 10x CPU it does in normal mode.
Interestingly, if I fire a request on the app, CPU usage drops to minimal after finishing the request for a while. But after a few minutes it starts consuming 10x CPU again.
First I would have suspected scotty, however collecting time profiling info with -p, -P or -Pa doesn't reveal much. That still not rules scotty out however.
To make matters worse, I inspect strange time profiling tick count I can't explain - the .prof file says "2 ticks @ 1000 us", while the application was clearly running idle for a good few seconds.
Any ideas what am I missing?
Thanks, Robin _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Erik Hesselink
-
Robin Palotai