Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


RDP1974 last won the day on September 29

RDP1974 had the most liked content!

Community Reputation

30 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. RDP1974

    PGPool Linux Apache top performance Delphi11

    hello, I consider that target a webbroker http app as apache module would have a lot of benefits: the code runs inside the process httpd, using the reliability and the scalability of the apache. I was curious to see the performances of the LLVM Linux compiler in the D11, having done integer tests and some benchmarks, I can tell that's on the level of the windows counterpart. But I can tell you that IIS isapi under Windows produces similar performance results. I have not benchmarked standalone webserver as Indy based webbroker or others, usually used to be managed as reverse proxy. I had liked to share the results with you, seeing how scalable can be a web app inside Linux Apache realm. btw.The unit wants to show how to enable the pooling in Firedac connections. kind regards
  2. RDP1974

    PGPool Linux Apache top performance Delphi11

    somebody ask me php details: php 8.0.11 latest JIT compiler enabled (faster mode as apache module), pooling enabled in php.ini (persistent) open connection query fetch lines close connection <?php // Connecting, selecting database $dbconn = pg_connect("host=localhost dbname=postgres user=postgres password=postgres") or die('Could not connect: ' . pg_last_error()); // Performing SQL query $query = 'SELECT * FROM enter'; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); // Printing results in HTML while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) { foreach ($line as $colvalue) { echo "$colvalue"; } } // Free resultset pg_free_result($result); // Closing connection pg_close($dbconn); ?> delphi apache: Server Software: Apache/2.4.41 Server Hostname: localhost Server Port: 80 Document Path: /test Document Length: 965 bytes Concurrency Level: 100 Time taken for tests: 0.642 seconds Complete requests: 10000 Failed requests: 0 Keep-Alive requests: 9957 Total transferred: 11768106 bytes HTML transferred: 9650000 bytes Requests per second: 15578.10 [#/sec] (mean) Time per request: 6.419 [ms] (mean) Time per request: 0.064 [ms] (mean, across all concurrent requests) Transfer rate: 17902.80 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 2 Processing: 1 6 6.4 6 175 Waiting: 1 6 6.4 6 175 Total: 1 6 6.5 6 177 Percentage of the requests served within a certain time (ms) 50% 6 66% 6 75% 7 80% 8 90% 10 95% 12 98% 18 99% 25 100% 177 (longest request) php 8 jit: Server Software: Apache/2.4.41 Server Hostname: localhost Server Port: 80 Document Path: /test.php Document Length: 902 bytes Concurrency Level: 100 Time taken for tests: 2.874 seconds Complete requests: 10000 Failed requests: 0 Keep-Alive requests: 9980 Total transferred: 11288500 bytes HTML transferred: 9020000 bytes Requests per second: 3479.01 [#/sec] (mean) Time per request: 28.744 [ms] (mean) Time per request: 0.287 [ms] (mean, across all concurrent requests) Transfer rate: 3835.23 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 3 Processing: 3 29 2.9 28 53 Waiting: 2 29 2.9 28 53 Total: 3 29 2.9 28 53 Percentage of the requests served within a certain time (ms) 50% 28 66% 29 75% 29 80% 30 90% 31 95% 33 98% 36 99% 41 100% 53 (longest request)
  3. sorry I don't want do cross posting, but don't know how to move this article from database section to this
  4. RDP1974

    PGPool Linux Apache top performance Delphi11

    plz Idera put Delphi Linux LLVM in Professional version too 🙂
  5. RDP1974

    PGPool Linux Apache top performance Delphi11

    100 concurrent users querying pgsql (to see scalability of the stack httpd with db) same setup test done with latest PHP (jit) and pooling enabled is doing 3000 reqs/sec delphi llvm linux apache with pooling 15000 reqs/sec (5x!!! the throughput of the php)
  6. hi, I like paste here a little unit helping coders to do scalable I/O http app look, I did an apachebench in a I9 virtualized ubuntu, with 100 concurrent users, asking this text through webbroker and firedac postgres sql query: «Tuttavia, perché voi intendiate da dove sia nato tutto questo errore, di quelli che incolpano il piacere ed esaltano il dolore, io spiegherò tutta la questione, e presenterò le idee espresse dal famoso esploratore della verità, vorrei quasi dire dal costruttore della felicità umana. Nessuno, infatti, detesta, odia, o rifugge il piacere in quanto tale, solo perché è piacere, ma perché grandi sofferenze colpiscono quelli che non sono capaci di raggiungere il piacere attraverso la ragione; e al contrario, non c'è nessuno che ami, insegua, voglia raggiungere il dolore in se stesso, soltanto perché è dolore, ma perché qualche volta accadono situazioni tali per cui attraverso la sofferenza o il dolore si cerca di raggiungere un qualche grande piacere. Concentrandoci su casi di piccola importanza: chi di noi intraprende un esercizio ginnico, se non per ottenerne un qualche vantaggio? E d'altra parte, chi avrebbe motivo di criticare colui che desidera provare un piacere cui non segua nessun fastidio, o colui che fugge un dolore che non produce nessun piacere? Al contrario, però, noi con indignazione denunciamo e riteniamo meritevoli di odio quelli che, rammolliti e corrotti dai piaceri del momento, accecati dal desiderio, non prevedono a quali dolori e a quali sofferenze andranno incontro, e uguale colpa hanno quelli che abbandonano i propri doveri per pigrizia d'animo, cioè per evitare le fatiche e i dolori. Certamente è facile e rapido distinguere questi casi. Infatti nel tempo libero, quando abbiamo tutta la nostra possibilità di scegliere e niente ci ostacola dal fare ciò che ci piace di più, bisogna accogliere ogni piacere e respingere ogni dolore. Ma in altri momenti, o nei doveri inevitabili o negli obblighi che ci vengono dalle circostanze, spesso accadrà che si debba respingere il piacere e accogliere il fastidio. E così il saggio si regola scegliendo tra questi atteggiamenti, facendo in modo che o – respingendo il piacere – ne ottenga di più grandi, o – sopportando il dolore – ne eviti di peggiori.» calling an Apache2 module webbroker the system raw performances are impressive, producing 18000 (18 thousands) sustained http requests for sec pgsql local limits 1000, ssl off put PhysPG with libpq.so in lib path over the datamodule here the unit to use, before you can set this on webbroker source begin {$IFDEF MSWINDOWS} CoInitFlags := COINIT_MULTITHREADED; {$ENDIF} Web.ApacheApp.InitApplication(@GModuleData); Application.Initialize; Application.MaxConnections:=1000; Application.WebModuleClass := WebModuleClass; Application.Run; end. the unit to interface pooled pg unit PGPool; interface uses {$IFDEF WINDOWS} Windows, FireDAC.VCLUI.Wait, {$ENDIF} Classes, System.SysUtils, // FireDAC.Phys.PG, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.Comp.DataSet, FireDAC.Comp.Client; type TDB = class public DBC: TFDConnection; DBQ: TFDQuery; DBT: TFDTransaction; constructor Create; destructor Destroy; override; end; implementation procedure InitPool; var oParams: TStrings; begin oParams := TStringList.Create; oParams.Add('DriverID=PG'); oParams.Add('User_Name=USERNAME'); oParams.Add('Server=ADDRESS'); oParams.Add('Password=PASSWORD'); oParams.Add('Database=DBNAME'); // oParams.Add('CharacterSet=none'); oParams.Add('Pooled=True'); oParams.Add('POOL_CleanupTimeout=3600000'); oParams.Add('POOL_ExpireTimeout=600000'); oParams.Add('POOL_MaximumItems=1000'); FDManager.Close; while FDManager.State <> dmsInactive do Sleep(1); FDManager.Open; FDManager.AddConnectionDef('PG_Pooled', 'PG', oParams); oParams.Free; end; constructor TDB.Create; begin inherited; // init connection DBC := TFDConnection.Create(nil); DBC.ConnectionDefName := 'PG_Pooled'; DBC.LoginPrompt := False; DBC.FetchOptions.Unidirectional := True; DBC.UpdateOptions.RequestLive := False; DBC.Transaction := DBT; // init transaction DBT := TFDTransaction.Create(nil); DBT.Connection := DBC; // init query DBQ := TFDQuery.Create(nil); DBQ.Connection := DBC; DBQ.Transaction := DBT; DBQ.FetchOptions.Unidirectional := True; DBQ.UpdateOptions.RequestLive := False; DBC.Connected := True; end; destructor TDB.Destroy; begin DBQ.Free; DBT.Free; DBC.Free; inherited; end; initialization InitPool; end. eg. with TDB.Create do begin try DBQ.SQL.Text := 'select * from table'; DBQ.Open; while not DBQ.eof do begin S := S + DBQ.FieldByName('test').asString + '<br>' + FormatDateTime('ddmmyyyy hh:nn:ss', Now) + '<br>'; DBQ.Next; end; finally Free; end; end; kind regards R.
  7. I forgot: I use Delphi 11 SOLVED was a permission config in pg_hba.conf works perfectly
  8. hello, I'm coding a software using webbroker Linux Apache Module and PG pooled Firedac the performances are outstanding hovewer with PG13, libpq 5 on a basic query I get [FireDAC][Phys][PG][libpq] ERROR: relation "name" does not exist any idea how to solve? the FDConnection has in the database field the correct database name thank you I forgot: I use Delphi 11
  9. RDP1974

    Compiler version for Alexandria

    do you know if generated machine win64 code is better than before?
  10. RDP1974

    json string to FD MemTable

    ah Webbroker calling Request.Content (example for POST body) is applying encoding/decoding text but there is a method to access the raw content as TBytes I found webbroker classes to be excellent
  11. RDP1974

    json string to FD MemTable

    var LField: TField; begin mtEmpty.LoadFromJSON(memoEmpty.Lines.Text); for LField in mtEmpty.Fields do mmDataType.Lines.Add(Format('Field: %s - %s', [LField.FieldName, GetEnumName(System.TypeInfo(TFieldType), Ord(LField.DataType))])); this is enough, calling LoadFromJSON directly from firedac table however (webbroker post) if I load from Request.ContentFields.Text (posting raw json) I get a general error if I load from Request.ContentFields.Values['mandatory'] it's working then some minor trouble re-serializing with JsonSuperObject with characters unicode utf8, etc. I'll take a look
  12. RDP1974

    json string to FD MemTable

    I have found this https://github.com/viniciussanchez/dataset-serialize
  13. hello, can someone has a function that pass a JSON array string -> to a -> Firedac TFDMemTable thanks
  14. RDP1974

    gnEdit2k component

    I need to compile an application done 15 years ago gnEdit2k was a TEdit enhanced, with bitmaps and unicode unfortunately I haven't a copy of it
  15. RDP1974

    gnEdit2k component

    hello, I need a component from the 2004 named gnEdit2k please can somebody help me?