[erlang-questions] profiling network apps: fprof vs sequential tracing

Björn-Egil Dahlberg egil@REDACTED
Fri Sep 17 17:01:43 CEST 2010

On 2010-09-17 15:23, Joel Reymont wrote:
> Suppose I'm trying to profile a web app running on top of mochiweb.
> The app starts processes for every request coming in and these talk to other processes that use the disk, etc. There are a few hundred requests in a single benchmarking run.
> I'm measuring disk write performance and see that it slows down to a crawl sometimes.
> Has anyone used fprof or sequential tracing to identify bottlenecks in this or similar scenario?
> The problem with fprof is that it aggregates by process. This means I have several hundred profiling sets, one per request, in a 79mb text file. It's very hard to find a bottleneck in such a huge file, specially when it's split per process.

I'm not a 100% sure on what you are after but there are a couple of 
alternatives to fprof for finding bottlenecks.

You can use eprof to find processes + code that produces bottlenecks. It 
is somewhat limited compared to fprof (no callgraph for instance) but is 
is much much faster (especially after the rewrite to r14) and will 
likely identify problematic intersections of processes and code.

For parallelism issues you can use lcnt. You need to recompile your 
erlang binary with lcnt enabled (not for production use). lcnt will 
pinpoint locks with long acquisition time and high collision rates, 
which is a signal of high contention for specific memory areas.


More information about the erlang-questions mailing list