Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App stops working after many requests #4

Open
msmaldi opened this issue Feb 9, 2020 · 7 comments
Open

App stops working after many requests #4

msmaldi opened this issue Feb 9, 2020 · 7 comments
Assignees
Labels

Comments

@msmaldi
Copy link

msmaldi commented Feb 9, 2020

Running sample in README.md

if run:
siege -c 8 -r 1024 http://0.0.0.0:3003

App stop response.

the problem only occurs with fork, if remove fork the app never stop:
Server.@new ("http", handler: new App ()).run ({"app", "--address=0.0.0.0:3003" });

@arteymix
Copy link
Member

arteymix commented Feb 9, 2020

I have always had issue with the libsoup backend which does not really fit nicely with the async request handling VSGI does. Have you tried other backends? Like a SCGI with NGINX reverse proxy?

I'll take a look.

@msmaldi
Copy link
Author

msmaldi commented Feb 9, 2020

How do I do thats?

@arteymix
Copy link
Member

arteymix commented Feb 10, 2020

@arteymix arteymix self-assigned this Feb 10, 2020
@arteymix arteymix added the bug label Feb 10, 2020
@msmaldi
Copy link
Author

msmaldi commented Feb 10, 2020

I'm looking for an ultra fast server
Its works, but performance is very very slow
vgsi + nginx:

$ siege -c 8 -r 1024 localhost
** SIEGE 4.0.4
** Preparing 8 concurrent users for battle.
The server is now under siege...
Transactions:		        8192 hits
Availability:		      100.00 %
Elapsed time:		       60.61 secs
Data transferred:	        0.09 MB
Response time:		        0.01 secs
Transaction rate:	      135.16 trans/sec
Throughput:		        0.00 MB/sec
Concurrency:		        1.06
Successful transactions:        8192
Failed transactions:	           0
Longest transaction:	       60.06
Shortest transaction:	        0.00

my current server implemented in c + nginx reverse proxy:

$ siege -c 8 -r 10240 http://localhost
** SIEGE 4.0.4
** Preparing 8 concurrent users for battle.
The server is now under siege...
Transactions:		       81920 hits
Availability:		      100.00 %
Elapsed time:		        1.84 secs
Data transferred:	        7.03 MB
Response time:		        0.00 secs
Transaction rate:	    44521.74 trans/sec
Throughput:		        3.82 MB/sec
Concurrency:		        6.79
Successful transactions:       81920
Failed transactions:	           0
Longest transaction:	        0.01
Shortest transaction:	        0.00

The performance of scgi may is a bug too

@arteymix
Copy link
Member

It looks like a bug, you seem to have a bunch of very fast requests and one with a very lengthy timeout (60 seconds). Can I take a look at the application code?

@arteymix
Copy link
Member

VSGI has basically no overhead beside parsing and generating SCGI messages, so I would doubt these numbers reflect the true performance.

@msmaldi
Copy link
Author

msmaldi commented Feb 11, 2020

My code is a simple demonstration

using VSGI;

class App : Handler
{
    public override async bool handle_async (Request req, Response res) throws Error
    {
        return yield res.expand_utf8_async ("Hello world!");
    }
}

Server.@new ("scgi", handler: new App ()).run ({"app", "--address=0.0.0.0:3003", "--forks=4" });

the process use 0% of cpu, maybe has many thread locks, maybe scgi is not closing connection, and is finished after 1min (60sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants