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

🚀(api) run database migration in post-deployment hook #355

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jmaupetit
Copy link
Member

Purpose

Running database migrations while the application is booting is a non-sense as every container booting will try to run migrations concurrently.

Proposal

  • run database migrations in a post-deployment hook

@jmaupetit jmaupetit self-assigned this Jan 23, 2025
@jmaupetit jmaupetit added bug Something isn't working critical API Item related to the API service labels Jan 23, 2025
Instead of running it before starting the service. Or else every web
container starting will try to run migrations concurrently...
Copy link

Current benchmark

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s Failures/s 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100% git timestamp version
GET /auth/whoami 27 0 670.0 599.491735814817 7.875505000015437 1630.8916700000111 160.0 0.928853135052378 0.0 670 730 780 830 1100 1100 1600 1600 1600 1600 1600 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
POST /dynamique/session/ 40 0 510.0 662.0405702500008 6.079768999995849 2213.5621500000016 45.0 1.3760787185961156 0.0 550 780 910 1100 1700 2100 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
POST /dynamique/session/bulk 26 0 420.0 664.0653892692301 22.622576999992816 2195.103343999989 411.0 0.8944511670874752 0.0 630 740 1000 1000 1800 1900 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
GET /dynamique/status/ 27 0 690.0 708.1771420740725 27.70988299999999 2210.002228999997 274.51851851851853 0.928853135052378 0.0 690 870 1100 1200 1400 1700 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
POST /dynamique/status/ 29 0 460.0 754.0034335172402 17.612759999991567 2063.3526929999844 45.0 0.9976570709821838 0.0 460 1000 1100 1600 2000 2000 2100 2100 2100 2100 2100 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3 36 0 910.0 936.8581929722224 6.1117489999844565 2231.9435649999946 271.1111111111111 1.238470846736504 0.0 910 1000 1400 1700 2100 2200 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3/history 37 0 670.0 658.2930098108117 7.005621999979894 2214.9872770000056 45532.78378378379 1.272872814701407 0.0 670 1000 1000 1100 1400 2000 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
POST /dynamique/status/bulk 31 0 750.0 789.0691559677431 28.159944999998743 2045.4541709999887 411.0 1.0664610069119895 0.0 750 910 1100 1200 1400 1900 2000 2000 2000 2000 2000 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
POST /statique/ 32 11 320.0 611.0412206562488 56.69024900001318 1946.1325010000223 63.1875 1.1008629748768926 0.3784216476139317 330 860 1100 1100 1400 1900 1900 1900 1900 1900 1900 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
GET /statique/?limit=10 36 0 640.0 722.2151256388922 20.439089000007016 2231.890636000003 13826.472222222224 1.238470846736504 0.0 730 930 1100 1200 1400 2100 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
GET /statique/?limit=100 39 0 750.0 816.4239508461538 135.50801700000648 2212.384003000011 129006.43589743588 1.3416767506312128 0.0 750 980 1100 1200 1900 2000 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
PUT /statique/FR073EP7QU5233 37 0 730.0 848.5872230000026 49.62088999999992 2211.405079999992 1371.0 1.272872814701407 0.0 730 1000 1200 1400 2000 2100 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
GET /statique/FRALLEGO002006P3 36 0 740.0 811.5457682777785 21.059188999998923 2233.23762199999 1202.0 1.238470846736504 0.0 830 1100 1300 1300 2000 2200 2200 2200 2200 2200 2200 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
POST /statique/bulk 36 0 950.0 1187.516847749997 324.368493999998 2498.777974999996 1118.388888888889 1.238470846736504 0.0 1100 1400 1800 1800 2100 2200 2500 2500 2500 2500 2500 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0
Aggregated 469 11 730.0 776.5947578805973 6.079768999995849 2498.777974999996 15774.038379530915 16.134522975539454 0.3784216476139317 730 940 1100 1200 1900 2100 2200 2200 2500 2500 2500 a60327e 2025-01-23 15:42:10.536424+00:00 0.16.0

Comparison with the latest previous benchmark

A lower (negative) value means the current version performs better than the previous one.

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s
GET /auth/whoami
POST /dynamique/session/
POST /dynamique/session/bulk
GET /dynamique/status/
POST /dynamique/status/
GET /dynamique/status/FRALLEGO002006P3
GET /dynamique/status/FRALLEGO002006P3/history
POST /dynamique/status/bulk
POST /statique/
GET /statique/?limit=10
GET /statique/?limit=100
PUT /statique/FR073EP7QU5233
GET /statique/FRALLEGO002006P3
POST /statique/bulk
Aggregated

@jmaupetit jmaupetit merged commit 114566d into main Jan 23, 2025
15 checks passed
@jmaupetit jmaupetit deleted the fix-api-deployment branch January 23, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Item related to the API service bug Something isn't working critical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants