ohler55 / agoo-c

Agoo webserver in C.
MIT License
146 stars 16 forks source link

Make issues #1

Closed bertbeck closed 5 years ago

bertbeck commented 5 years ago

What is the correct procedure for building?

make in the root directory produces this:

bert@ubuntu-1:~/projects/agoo-c$ make make -C src refresh make[1]: Entering directory /home/bert/projects/agoo-c/src' mkdir -p agoo echo "all:\n make -C ..\n" > agoo/Makefile cp ../../agoo/ext/agoo/atomic.h agoo cp: cannot stat ‘../../agoo/ext/agoo/atomic.h’: No such file or directory make[1]: *** [refresh] Error 1 make[1]: Leaving directory/home/bert/projects/agoo-c/src' make: *** [all] Error 2

ohler55 commented 5 years ago

A simple make from the src directory should do it. Agoo-c uses code from the Agoo repo so that's what the make refresh does. I'll add some build instructions.

I'm curious, are you looking for a straight server or one that does GraphQL? Agoo-c was made initially to participate in benchmarks. I think I can get a bit more out of it performance-wise in the near future.

Anyway, if you are going to spend some time with it I am glad to improve it and add features.

bertbeck commented 5 years ago

hmmm. I did a make from src. Will try again but I'm pretty sure it couldn't find some includes.

I'm just trying the simple example build. My goal is to find the fastest simple web server to benchmark against my development efforts in crystal go and rust. I can't get more that 2,000 request/seconds on my local mac, or about 1700 rps on Digital Ocean and AWS small instances. Your benchmarks seemed faster from a site I found on the web.

Are you doing selects/non blocking io on sockets? That seems to be the answer for higher performance. Digital Ocean and AWS just have 1 core - so multiple threads probably don't help.

Should I do a "make refresh" first?

Thanks

Bert

On Wed, Apr 10, 2019 at 6:59 PM Peter Ohler notifications@github.com wrote:

A simple make from the src directory should do it. Agoo-c uses code from the Agoo repo so that's what the make refresh does. I'll add some build instructions.

I'm curious, are you looking for a straight server or one that does GraphQL? Agoo-c was made initially to participate in benchmarks. I think I can get a bit more out of it performance-wise in the near future.

Anyway, if you are going to spend some time with it I am glad to improve it and add features.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ohler55/agoo-c/issues/1#issuecomment-481925573, or mute the thread https://github.com/notifications/unsubscribe-auth/AF37QoHGFvQ9IepoT6KERcBjzSsDgUYeks5vfokBgaJpZM4coWlj .

bertbeck commented 5 years ago

still no luck.

It looks like the makefile expects the project to be in the agoo directory

where does the ext directory come from?

I've tried building in both master and develop - git clone sets develop as the current branch

Here's my results:

bert@ubuntu-1:~/projects/agoo-c$ cd src

bert@ubuntu-1:~/projects/agoo-c/src$ make refresh

mkdir -p agoo

echo "all:\n make -C ..\n" > agoo/Makefile

cp ../../agoo/ext/agoo/atomic.h agoo

cp: cannot stat ‘../../agoo/ext/agoo/atomic.h’: No such file or directory

make: *** [refresh] Error 1

bert@ubuntu-1:~/projects/agoo-c/src$ ls ../..

agoo-c nodeapp rust_ws web-frameworks

agoo-c-save nodehero-authentication SinglePageApp webserver_c

h2o npm-debug.log skiapp ws_crystal

haywire OnTheSnow_ws snowflake wslay

micro-service onthesnow.zip sparkle

ngrest react-universal-web-apps-simple tabs

bert@ubuntu-1:~/projects/agoo-c/src$ cd ..

bert@ubuntu-1:~/projects/agoo-c$ cd ..

bert@ubuntu-1:~/projects$ mv agoo-c agoo

bert@ubuntu-1:~/projects$ cd agoo

bert@ubuntu-1:~/projects/agoo$ cd src

bert@ubuntu-1:~/projects/agoo/src$ make refresh

mkdir -p agoo

echo "all:\n make -C ..\n" > agoo/Makefile

cp ../../agoo/ext/agoo/atomic.h agoo

cp: cannot stat ‘../../agoo/ext/agoo/atomic.h’: No such file or directory

make: *** [refresh] Error 1

bert@ubuntu-1:~/projects/agoo/src$ cd ..

bert@ubuntu-1:~/projects/agoo$ ls

CHANGELOG.md example include lib LICENSE Makefile README.md src

bert@ubuntu-1:~/projects/agoo$

On Wed, Apr 10, 2019 at 10:11 PM Bert Beckmann bertbeck@gmail.com wrote:

hmmm. I did a make from src. Will try again but I'm pretty sure it couldn't find some includes.

I'm just trying the simple example build. My goal is to find the fastest simple web server to benchmark against my development efforts in crystal go and rust. I can't get more that 2,000 request/seconds on my local mac, or about 1700 rps on Digital Ocean and AWS small instances. Your benchmarks seemed faster from a site I found on the web.

Are you doing selects/non blocking io on sockets? That seems to be the answer for higher performance. Digital Ocean and AWS just have 1 core - so multiple threads probably don't help.

Should I do a "make refresh" first?

Thanks

Bert

On Wed, Apr 10, 2019 at 6:59 PM Peter Ohler notifications@github.com wrote:

A simple make from the src directory should do it. Agoo-c uses code from the Agoo repo so that's what the make refresh does. I'll add some build instructions.

I'm curious, are you looking for a straight server or one that does GraphQL? Agoo-c was made initially to participate in benchmarks. I think I can get a bit more out of it performance-wise in the near future.

Anyway, if you are going to spend some time with it I am glad to improve it and add features.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ohler55/agoo-c/issues/1#issuecomment-481925573, or mute the thread https://github.com/notifications/unsubscribe-auth/AF37QoHGFvQ9IepoT6KERcBjzSsDgUYeks5vfokBgaJpZM4coWlj .

ohler55 commented 5 years ago

Sorry, I can't get to the adding the docs and changes til this evening but here are the steps. (Don't do a make refresh. That's for me only. I'll make that step separate to avoid confusion.)

Start with fresh pull so all the files are there.

cd src
make

Then to try an example.

cd example/simple
make

The simple app should be ready to run.

ohler55 commented 5 years ago

I pushed a better README.md and also changed the Makefile. Let me know it you are able to get the project and example to build. Thanks.

bertbeck commented 5 years ago

I finally got it to work - it needs a more current version of gcc. I had 4.7 running on ubuntu 14.04. I had to upgrade to gcc-7 to get stdatomic.h to be included.

Interesting - I'm benchmarking various simple web services / micro services on Digital Ocean, AWS and my Macbook pro - just responding to a "/" get request and sending an empty response. I'm only able to get < 2000 requests per second as benchmarked by wrk2. Yours does 1633 rps. I've tried a libuv version as well and still always under 2000 requests per second. I've run the same code on aws (micro instance) and same results.

Did you do any benchmarking of your performance? I'm thinking that maybe digital ocean and aws or comcast (my ISP) might be rate limiting - but maybe not. I usually seem claims of 20K request per seconds - but I don't see this.

I'd update your docs to note that you require a modern C11 compiler (or gcc-7)

Bert

On Thu, Apr 11, 2019 at 3:14 PM Peter Ohler notifications@github.com wrote:

I pushed a better README.md and also changed the Makefile. Let me know it you are able to get the project and example to build. Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ohler55/agoo-c/issues/1#issuecomment-482316597, or mute the thread https://github.com/notifications/unsubscribe-auth/AF37QrXV5piJP_ZCtmywl59VSg370Du4ks5vf6WhgaJpZM4coWlj .

ohler55 commented 5 years ago

Updated the README, thanks.

Some benchmarks for Agoo-C are here.

I suspect the slow results you are getting are due to the network. If you are testing on AWS then test both the web server and the benchmark tool on the AWS network. Make sure you have a decent bandwidth. If you are benchmarking across the internet don't expect good results as the network will be the bottleneck.

Some other things to consider. Make sure the connection is kept alive. With wrk that is the default. For something like my perfer use the -k option. Also many server support pipeline which allows multiple requests to be outstanding from the same client. For perfer that is the -b option.

I test on my laptop and easily get over 100,000 request per second.

bertbeck commented 5 years ago

Aha!

I see that in the wrk command there is a --rate parameter that was set to

  1. I took an example off the web. When I set it to 20,000, throughput climbs to 20,000 for running local It is still just 1640 rps running on Digital Ocean - maybe a bandwidth limitation on Comcast or Digital Ocean. In the end - real world internet requests per second is what I'm interested in. I've seen a few load testers that spread out over the web - will give those a try.

Have you done any load testing with queries into a postgres database?

On Thu, Apr 11, 2019 at 6:08 PM Peter Ohler notifications@github.com wrote:

Updated the README, thanks.

Some benchmarks for Agoo-C are here https://github.com/the-benchmarker/web-frameworks.

I suspect the slow results you are getting are due to the network. If you are testing on AWS then test both the web server and the benchmark tool on the AWS network. Make sure you have a decent bandwidth. If you are benchmarking across the internet don't expect good results as the network will be the bottleneck.

Some other things to consider. Make sure the connection is kept alive. With wrk that is the default. For something like my perfer use the -k option. Also many server support pipeline which allows multiple requests to be outstanding from the same client. For perfer that is the -b option.

I test on my laptop and easily get over 100,000 request per second.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ohler55/agoo-c/issues/1#issuecomment-482379868, or mute the thread https://github.com/notifications/unsubscribe-auth/AF37QloX5AfllqmiH2U6JnffPHRL2g5xks5vf86HgaJpZM4coWlj .

bertbeck commented 5 years ago

I'm getting about 70K rps running on my macbook (client and server running on the same machine)

On Thu, Apr 11, 2019 at 9:06 PM Bert Beckmann bertbeck@gmail.com wrote:

Aha!

I see that in the wrk command there is a --rate parameter that was set to

  1. I took an example off the web. When I set it to 20,000, throughput climbs to 20,000 for running local It is still just 1640 rps running on Digital Ocean - maybe a bandwidth limitation on Comcast or Digital Ocean. In the end - real world internet requests per second is what I'm interested in. I've seen a few load testers that spread out over the web - will give those a try.

Have you done any load testing with queries into a postgres database?

On Thu, Apr 11, 2019 at 6:08 PM Peter Ohler notifications@github.com wrote:

Updated the README, thanks.

Some benchmarks for Agoo-C are here https://github.com/the-benchmarker/web-frameworks.

I suspect the slow results you are getting are due to the network. If you are testing on AWS then test both the web server and the benchmark tool on the AWS network. Make sure you have a decent bandwidth. If you are benchmarking across the internet don't expect good results as the network will be the bottleneck.

Some other things to consider. Make sure the connection is kept alive. With wrk that is the default. For something like my perfer use the -k option. Also many server support pipeline which allows multiple requests to be outstanding from the same client. For perfer that is the -b option.

I test on my laptop and easily get over 100,000 request per second.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ohler55/agoo-c/issues/1#issuecomment-482379868, or mute the thread https://github.com/notifications/unsubscribe-auth/AF37QloX5AfllqmiH2U6JnffPHRL2g5xks5vf86HgaJpZM4coWlj .

ohler55 commented 5 years ago

I have not done any load testing with postgres. A bit with mongodb though. It is not very fast out of the box.

70K sounds about right for a macbook running macOS. Boot it into linux and you should see results that are 50% faster. macOS doesn't do very well with IO compared to linux.

ohler55 commented 5 years ago

Can this be closed?

bertbeck commented 5 years ago

Yes

On Thu, Apr 18, 2019 at 9:50 AM Peter Ohler notifications@github.com wrote:

Can this be closed?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ohler55/agoo-c/issues/1#issuecomment-484569514, or mute the thread https://github.com/notifications/unsubscribe-auth/ABO7WQQGHWENVHHVJWGQHNLPRCKDZANCNFSM4HFBNFRQ .