# Plug POST performance

**URL:** <https://forum.elixirforum.com/t/plug-post-performance/473>\
**Category:** Questions\
**Tags:** performance\
**Created:** [April 30, 2016, 2:31pm UTC](https://forum.elixirforum.com/t/plug-post-performance/473 "2016-04-30T14:31:23Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![sasajuric](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/32/991_2.png) [@sasajuric](https://forum.elixirforum.com/u/sasajuric)\
**Post date:** [May 1, 2016, 5:23pm UTC](https://forum.elixirforum.com/t/plug-post-performance/473/8 "2016-05-01T17:23:46Z")

</div>

> [@apenney](#):
>
> In no case was the CPU ever fully loaded, we were averaging about 60% idle which is why I became convinced we must have hit some “bottleneck”, but we couldn’t prove that out.

Until you’re able to get to 100% CPU usage under the load you’re probably hitting some bottleneck somewhere. Here are some additional suggestions for discovering it:

- Whether you’re using exrm or not, make sure to load test the code compiled with `MIX_ENV=prod`
- If you’re load testing simple 204 response, make sure to keep `Plug.Parsers` out. Using it might cause the body to be loaded (see `Plug.Parsers.JSON`), and the throughput of your simple CPU-bound code might become I/O bound.
- Consider temporarily moving Plug/http out of the picture. Write a simple program that spawns a couple of processes (at least as many as you have cores), and make those processes CPU bound. They could run an infinite loop which invokes `:rand.uniform`, or something similar. Just make sure they’re not receiving messages, sleeping, or doing I/O bound work. Check if you’re getting 100% CPU usage. If not, then take try playing with [erl options](http://erlang.org/doc/man/erl.html) and see if it helps.
- Start the observer, then load test the system for a while. If you have a bottleneck in the system, it might show up in the processes tab during the load test. Sort the view by reds and/or message queue, and try to see if some process is constantly on/near the top of the list with a large message queue. If yes, that’s a possible bottleneck.

Only when you reach CPU usage of 100% can you consider comparing Scala vs Erlang/Elixir, and also think about possible optimizations in your code. Before that, some other bottleneck is likely making your system less efficient than it could be.

Good luck! 🙂

---

_[View the full topic](https://forum.elixirforum.com/t/plug-post-performance/473)._
