Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

IsapiScale

make web server Delphi apps scalable

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

IsapiScale

a pair of hints to make Delphi isapi web app scalable and reliable

of course Delphi has the safe memory as Rust, the OOP quicker and elegant than C++ thanks to an optimized VMT, faster execution time due to smaller pe size that fit into L1 cpu cache

so for newbies there it is a sample to make Windows Server isapi applications flying

  1. using a scalable allocator (see mine repositories)
  2. set keep-alive
  3. set max connections higher
  4. don't use globally unique firedac elements also saving time to recreate connections and queries, so:
  5. manage easy threadvar for database objects
  6. use database pooling
  7. let me suggest a fastest json parser https://github.com/ahausladen/JsonDataObjects and use type casting instead of variants*:

no jealousy towards techempower's c++ frameworks 🙂

a test with D12.3 and i9900 cpu within windows server 2025, push the number of messages with sql query from 750 to 5000 for sec (MySQL 8.4.5** LTS)

(ab -n 10000 -c 1000 -k http://address/isapiscale.dll/scale) with 1000 concurrent users

document path: /isapi/isapiscale.dll/scale

document length: 2425 bytes

concurrency level: 1000

time taken for tests: 1.968 seconds

Complete requests: 10000

failed requests: 0

keep-alive requests: 10000

total transferred: 25950000 bytes

HTML transferred: 24250000 bytes

requests per second: 5081.92*** [#/sec] (mean)

(ubuntu 25.04 same vm and mysql config -> apache mod ~2500 reqs/s)

time per request: 196.776 [ms] (mean)

time per request: 0.197 [ms] (mean, across all concurrent requests)

transfer rate: 12878.49 [Kbytes/sec] received

this should increment linearly among all the cpu cores

  • cast the type eg. Obj.S['one'] := 'thisisastring' Obj.I['two'] := 2

(string, integer, float, etc.)

** as client libs use libmysql.dll, libssl-3-x64.dll, libcrypto-3-x64.dll

*** identical score among MSHeap and RDPMM64 (tbbmalloc) allocators

btw. using mysql sample database world

let me know opinions or errors, kind regards

rdp@dellapasqua.com

Roberto