-
Content Count
235 -
Joined
-
Last visited
-
Days Won
1
Everything posted by RDP1974
-
hello, can somebody suggest me a good virtual printer sdk (commercial) with delphi management capability (api, dll, dde or whatever) thank you
-
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.
-
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
-
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)
-
sorry I don't want do cross posting, but don't know how to move this article from database section to this
-
plz Idera put Delphi Linux LLVM in Professional version too 🙂
-
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)
-
PGSQL linux [FireDAC][Phys][PG][libpq] ERROR: relation does not exist
RDP1974 posted a topic in Databases
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 -
PGSQL linux [FireDAC][Phys][PG][libpq] ERROR: relation does not exist
RDP1974 replied to RDP1974's topic in Databases
I forgot: I use Delphi 11 SOLVED was a permission config in pg_hba.conf works perfectly -
do you know if generated machine win64 code is better than before?
-
hello, can someone has a function that pass a JSON array string -> to a -> Firedac TFDMemTable thanks
-
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
-
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
-
I have found this https://github.com/viniciussanchez/dataset-serialize
-
hello, I need a component from the 2004 named gnEdit2k please can somebody help me?
-
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
-
skia is the library used in Flutter, nice work, thank you!
-
hello, I own a regular license of D2007, however I miss the registration data, Emba doesn't support it anymore can somebody help me?
-
ah finally I have found the license keys thank you for the hints
-
https://blogs.embarcadero.com/add-the-powerful-angular-web-framework-to-your-delphi-apps/ https://github.com/HashLoad/horse https://github.com/viniciussanchez/examples https://github.com/viniciussanchez/embarcadero-conference/tree/master/2020/backend https://github.com/HashLoad/kanbana-api
-
seems well coded, small, highly modularized it's new... has a community of a thousand coders asking opinions
-
you are alright, I have changed the title
-
virtualization VMWare Workstation PRO vs MS Hyper-V
RDP1974 replied to Drewsky's topic in Delphi IDE and APIs
hyper-v is way faster in order of magnitude than vmware for desktop delphi ide usb you can insert them in client connect options -
WASM engine in pure Pascal - an interesting open source project to watch!
RDP1974 replied to Edwin Yip's topic in RTL and Delphi Object Pascal
so cool project! -
hello, I need to port a old Delphi 2007 app to Delphi 10.4 64bit and unicode MDI VCL with 1000+ forms ANSI codepage to a oracle using BDE and DBexpress third party components as WPCubed, TMS custom components do you know a good tutorial, or the most difficulties? can be good to use DUnit to test each converted mask? firedac dataset maps the same dbexpress events onchange, onupdate, etc.?