-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e9d79f
commit bc561f8
Showing
12 changed files
with
118 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
https://github.com/Scalingo/apt-buildpack | ||
https://github.com/Scalingo/nodejs-buildpack | ||
https://github.com/Scalingo/python-buildpack | ||
https://github.com/Scalingo/python-buildpack | ||
https://github.com/Scalingo/nginx-buildpack.git |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
gdal-bin | ||
libgdal-dev | ||
libgdal-dev |
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
web: bash bin/start | ||
postdeploy: bash bin/post_deploy |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
#!/bin/bash | ||
|
||
#gunicorn --timeout 300 --workers 20 --chdir core core.wsgi --log-file - | ||
#gunicorn core.asgi --worker-class=uvicorn.workers.UvicornWorker --max-requests 10000 --max-requests-jitter 20 --workers 5 --log-file - | ||
gunicorn core.asgi --timeout 300 --worker-class=core.custom_uvicorn_worker.CustomUvicornWorker --max-requests 2000 --max-requests-jitter 200 --workers 3 --log-file - | ||
bin/run & # nginx as a reverse proxy | ||
|
||
# if the current shell is killed, also terminate all its children | ||
trap "pkill SIGTERM -P $$" SIGTERM | ||
|
||
# wait for a single child to finish, | ||
wait -n | ||
# then kill all the other tasks | ||
pkill -P $$ |
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,45 @@ | ||
// k6 configuration file to simulate user behavior | ||
import http from "k6/http" | ||
import { sleep } from "k6" | ||
|
||
export const options = { | ||
stages: [ | ||
{ duration: "30s", target: 40 }, // Ramp-up to 19,110 concurrent users | ||
{ duration: "10s", target: 40 }, // Maintain 19,110 users | ||
{ duration: "5s", target: 0 }, // Ramp-down to 0 users | ||
], | ||
} | ||
|
||
export default function () { | ||
// Step 1: Visit the homepage | ||
http.get("https://quefairedemesobjets-preprod.osc-fr1.scalingo.io/dechet/") | ||
console.log("Visited homepage") | ||
sleep(0.568) // Time spent on the page in seconds | ||
|
||
// Step 2: Navigate to the first detailed page | ||
http.get("https://quefairedemesobjets-preprod.osc-fr1.scalingo.io/papier-et-carton") | ||
console.log("Visited page: Papier et Carton") | ||
sleep(0.59) // Time spent on the page in seconds | ||
|
||
// Step 3: Navigate to another detailed page | ||
http.get("https://quefairedemesobjets-preprod.osc-fr1.scalingo.io/plastique") | ||
console.log("Visited page: Plastique") | ||
sleep(0.797) // Time spent on the page in seconds | ||
|
||
// Step 4: Return to homepage with a theme parameter | ||
http.get("https://quefairedemesobjets-preprod.osc-fr1.scalingo.io/?theme=dechets") | ||
console.log("Visited homepage with theme parameter") | ||
sleep(1.903) // Time spent on the page in seconds | ||
|
||
// Step 5: Visit a different detailed page | ||
http.get("https://quefairedemesobjets-preprod.osc-fr1.scalingo.io/verre") | ||
console.log("Visited page: Verre") | ||
sleep(1.5) // Time spent on the page in seconds | ||
|
||
// Simulate user leaving the page | ||
http.get("https://quefairedemesobjets-preprod.osc-fr1.scalingo.io/batteries") | ||
console.log("Visited page: Batteries") | ||
sleep(3.0) // Time spent on the page in seconds | ||
|
||
// End of scenario | ||
} |
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,23 @@ | ||
server { | ||
listen <%= ENV['PORT'] %>; | ||
server_name _; | ||
|
||
location /static/ { | ||
alias /app/staticfiles/; | ||
add_header Cache-Control "public, max-age=31536000, immutable"; | ||
|
||
# Prevent access to hidden files | ||
location ~ /\. { | ||
deny all; | ||
} | ||
} | ||
|
||
location / { | ||
proxy_pass http://localhost:<%= ENV['PORT'] %>; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_pass http://unix:/tmp/gunicorn.sock; | ||
} | ||
} |
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