web-frameworks icon indicating copy to clipboard operation
web-frameworks copied to clipboard

Add resources consumption

Open schovi opened this issue 8 years ago • 16 comments

One library can have an awesome performance for the cost of ten times bigger CPU consumption than other which has like 2 times worse performance. I think it is important metrics.

Metrics can be normalized to something like "10 requests per 1%CPU or 1MB Ram" (just idea :)

schovi avatar May 09 '17 13:05 schovi

Ok, let's think about this. Is there any elegant way to measure them?

tbrand avatar May 09 '17 14:05 tbrand

@tbrand It is few days I see someone use Docker to measure the performance of something. Maybe that could be the way.

BTW: Using Docker could make this easier to run and integrate for more people. Have you ever consider to use Docker there?

schovi avatar May 09 '17 14:05 schovi

That's good approach:+1: If you have a specific reference, please let me know.

I'm thinking using docker, give me a time to do that.:smile:

tbrand avatar May 09 '17 14:05 tbrand

@tbrand I tried to do something fast there is running Docker for crystal and rails. https://github.com/tbrand/which_is_the_fastest/pull/33

schovi avatar May 10 '17 07:05 schovi

From a consistency standpoint, you could grab a snapshot of system load and ram usage at the 3/4 mark of the test. That would give you a fairly consistent "under stress" measurement that could be shown as a percentage of the whole.

brightball avatar May 10 '17 17:05 brightball

Or snapshots at certain intervals as well.

OvermindDL1 avatar May 10 '17 17:05 OvermindDL1

Sounds pretty good:+1:

tbrand avatar May 11 '17 12:05 tbrand

This might be good? https://docs.docker.com/engine/reference/commandline/stats/#examples

tbrand avatar May 12 '17 14:05 tbrand

This might be good? https://docs.docker.com/engine/reference/commandline/stats/#examples

Ooo, wonder when that was added, looks like it may work well!

OvermindDL1 avatar May 12 '17 14:05 OvermindDL1

Close?!

kalicki avatar Jan 22 '18 20:01 kalicki

Using Docker could have several advantages, and one of them could be getting consumption, #123

waghanza avatar Mar 01 '18 15:03 waghanza

I use standard time to measure most things:

alias time='/usr/bin/time -f "\nCPU: %U s\tReal: %e s\tRAM: %M KB"'

kokizzu avatar Apr 10 '20 20:04 kokizzu

in what is that helpful ?

waghanza avatar Apr 10 '20 20:04 waghanza

in measuring the max RAM usage '__')

kokizzu avatar Apr 10 '20 21:04 kokizzu

ah, I think this measure will come from the cloud provider we use ... but thanks for the tip :heart:

waghanza avatar Apr 11 '20 20:04 waghanza

This would be great if we also have RAM metrics like avg, min, max.

You could take a snapshot of docker stats every sec of the docker container I guess. I don't know if there is a simpler solution for this.

Tienisto avatar Nov 24 '23 16:11 Tienisto