Closed Sgiath closed 4 years ago
Hi @Sgiath,
Thanks for adding elixir
based frameworks in here
.
You work is very appreciable :heart:
/cc @essen @josevalim Could you please take a loo at this PR
?
@waghanza For note, you might not get responses from them as they are company workers. The licenses already allow for essentially any use.
@OvermindDL1 yep, I also think that asking for consent is not required ^^
However, it might be interesting to have their, not approval, but advice concerning this PR
:stuck_out_tongue: essentially for fine tuning ...
Ranch is not a Web framework so I'm not sure what's the point? You're measuring little more than TCP. Cowboy would be more appropriate, see for example https://postimg.cc/ZWM4CVRs for benchmark results for the upcoming version.
@OvermindDL1 Not sure what you mean by company workers, I'm just one guy.
@essen Sorry, I was speaking of jose. ^.^
And yeah, just noticed the above was ranch
, it should be cowboy
tested, cowboy
is the actual web server, ranch
is used by cowboy
for the tcp connector.
Plus both cowboy1 and cowboy2 run differently and are both in use, so perhaps both should be tested.
in deed, gen_tcp
or ranch
are NOT what is mainly called a framework, but is it not a set of library thus we can add it here
for example, here
lives https://github.com/ray-ang/basicphp which could be considered as a framework (the author calls it a nano one) but more bare-metal
in php
world
in deed,
gen_tcp
orranch
are NOT what is mainly called a framework, but is it not a set of library thus we can add ithere
for example,
here
lives https://github.com/ray-ang/basicphp which could be considered as a framework (the author calls it a nano one) but morebare-metal
inphp
world
Yeah but basicphp still is behind a Web server, imports a Web framework and such. It's equivalent to Cowboy, not Ranch.
convinced :heart: Thanks for clarification, but is your argument still valid for gen_tcp
?
gen_tcp
is built into the underlying VM's stdlib, it is the base-most (well...) TCP layer, it's just pure TCP sockets, nothing to do with HTTP at all.
@Sgiath I just want to ask you what you did ^^
As I said, I don't know this project much so I didn't realize it compared only the "full frameworks" :)
I removed the gen_tcp
and ranch
and added cowboy
.
Any comments to the code? Or is there something else I should add? (like enabling it in the measurement)
as this project is not very stable (yet), there is no documentation to refer to
but I take care any contribution :heart: (tests ...)
I can take a look at the Cowboy side of things tomorrow.
Would it be possible to have 2 Cowboy though? There's two interfaces, one low level and one high level. The low level interface is much faster. You can probably modify this example from @petrohi here: https://gitlab.com/stressgrid/dummies/-/tree/master/elixir_cowboy_fast_stream
Would it be possible to have 2 Cowboy though? There's two interfaces, one low level and one high level. The low level interface is much faster.
I do not work directly with :cowboy
library so I don't know it's internals too much. If you want to add the low-level cowboy please do :slightly_smiling_face:
Check the link I gave you. Just need to edit fast_stream.ex
to remove the sleep and perhaps change the configuration.
if you have 2 implementations of the same framework, please make them in two separate folders.
I'll merge them during https://github.com/the-benchmarker/web-frameworks/issues/1481
@essen I did add :cowboy
version using streams but I don't see any performance benefits when benchmarking locally (205 312 req/sec for streams vs 204 749 req/sec for the standard version). So maybe it could be implemented more efficiently.
Also options for both cowboy versions could be probably tweaked.
After adding compiler optimizations difference is more apparent:
606 731 req/sec for streams vs 476 103 req/sec for standard version
:slightly_smiling_face:
Hmm weird that you need this to see a difference, but I suppose it depends on the environment, Erlang version and such, and perhaps also depends on how you do the benchmarking. Thanks for adding it!
Assuming this is only HTTP/1.1 the Cowboy projects look fine (usual "I don't know Elixir" disclaimer). If benchmarking using HTTP/2 more configuration will be necessary, as the defaults are a bit low for benchmarks.
In other news, Cowboy 2.8 will be released sometimes in February and has received many optimizations, so keep an eye out for the release!
In other news, Cowboy 2.8 will be released sometimes in February and has received many optimizations, so keep an eye out for the release!
@dependabot will take care of it :stuck_out_tongue: (a PR
will be added for each new update)
@essen is the code OK for you
@OvermindDL1 could you take a look
@Sgiath is this PR
ready to be shipped ?
PS : I don't have any elixir
knowledge ?
@waghanza as far as I am concerned it is ready to be merged
I don't know Elixir but the Cowboy projects look fine.
Added frameworks:
:plug_cowboy
):cowboy
API):cowboy
low-level Stream API)I am not 100 % familiar with this project so I tried to replicate settings from other languages/frameworks but I am not sure I did it correctly.
Closes #2197 Closes #1353 Closes #89