Skip to content

Commit

Permalink
Merge pull request #87 from canonical/charm-use-gevent
Browse files Browse the repository at this point in the history
use gevent and keepalive to improve performance in the juju deployed …
  • Loading branch information
plars authored Aug 18, 2023
2 parents e2056fb + 0231aa4 commit 45b9d09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charm/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ options:
default: testflinger.local
description: external hostname for accessing testflinger server
type: string
keepalive:
default: 10
description: Number of seconds to wait for keepalive connections
type: int
5 changes: 5 additions & 0 deletions charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,14 @@ def _on_config_changed(self, _: ops.framework.EventBase) -> None:
@property
def _pebble_layer(self):
"""Return a dictionary representing a Pebble layer."""
keepalive = str(self.config["keepalive"])
command = " ".join(
[
"gunicorn",
"-k",
"gevent",
"--keep-alive",
keepalive,
"--bind",
"0.0.0.0:5000",
"testflinger:app",
Expand Down

0 comments on commit 45b9d09

Please sign in to comment.