-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Api server should limit maximum number of concurrent requests,…
… when customers limit the fd's they should be allowed to limit the maximum number of concurrent requests to api-server." into R2.0
- Loading branch information
Showing
5 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. | ||
# | ||
|
||
def get_bottle_server(pool_size): | ||
""" | ||
Custom gevent pool server for bottle | ||
""" | ||
from bottle import GeventServer | ||
from gevent.pool import Pool | ||
|
||
class GeventPoolServer(GeventServer): | ||
""" Gevent server with limited pool size | ||
""" | ||
def __init__(self, host='127.0.0.1', port=8080, **options): | ||
super(GeventPoolServer, self ).__init__(host, port, | ||
spawn=Pool(size=pool_size), **options) | ||
|
||
return GeventPoolServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters