1

I have a problem with the spectre/meltdown patch from windows (it got released somewhere around Q1 last year). When activated, my delphi REST service is being slowed down about 15 times (so if a request takes 1 second, with the activated patches its about 15 seconds). I have traced the slowdown down to the database connection. Somehow the translation from parameters, after they have all been set, to the sql text, takes really long and then the execution on the database itself takes a lot longer than usual. First I helped myself by cutting down the sql statement to couple of rows, and it got faster (so more rows mean a lot more time. Approximately its like, if you add one more row to an update/insert statement it takes 0.2-0.3 seconds more to process the transaction. As far as I saw it, select statements work fine). After I got the same issue on other requests, and the application is still in development, I turned of the patches, and everything got a lot faster. Now the administrator insists that the patches are being turned on, and the problem is there again .

Did anybody experience something like this, or is there a possiblity to exclude an application from being targeted by the patches? The strange thing is, I also have an client/server application that is using the same business logic. The client/server application is also being slowed down, but approximately just around the factor of 2. So thats the thing that I dont quite understand. With the same functions, it takes a lot longer from within the service, than from the client/server application.

Ah yes, I am using devart for the database connection, and its an mssql server (2016). The service and the client/server application are written in delphi XE7 (now trying to update do Xe10.2 hoping that this will help)

Thanks

rimes
  • 761
  • 1
  • 8
  • 25
  • Replace the processor with one that is not susceptible to this vuln – David Heffernan Jan 10 '19 at 10:04
  • 1
    that would be great :) But the problem is, that the application is being distributed to hunderts of customers (after its finished) – rimes Jan 10 '19 at 10:06
  • Wait for 19H1 to incorporate the retpoline strategy and check again. – Stefan Glienke Jan 10 '19 at 16:03
  • this is a 100% MSSQL side problem I guess - Delphi doesn't implement any spectre/meltdown patch in its compiler, so the slowness is not in Delphi nor DevArt, but in MSSQL - but a 15 times slowdown is pretty unexpected, since patches only reduce the speed by a few percents... I guess there is something wrong elsewhere – Arnaud Bouchez Jan 10 '19 at 16:18
  • @StefanGlienke that would be great if Microsoft would fix this on their own. I am wondering that I cant find any information about somebody else experiencing the same thing (I dont think that there is anything special on my application causing this behaviour) – rimes Jan 11 '19 at 09:16
  • @ArnaudBouchez I am not sure that it is MSSQL causing this behaviour. If it was like this, then it would be the same from within the clinet/server application – rimes Jan 11 '19 at 09:16
  • @ArnaudBouchez There are patches in Windows that have the potential to slow down every software - however I have not read about 15 times slower. see https://cloudblogs.microsoft.com/microsoftsecure/2018/01/09/understanding-the-performance-impact-of-spectre-and-meltdown-mitigations-on-windows-systems/ for more details. – Stefan Glienke Jan 11 '19 at 09:31
  • @StefanGlienke that was my point :) – Arnaud Bouchez Jan 11 '19 at 16:07
  • Hi, My problem was solved by migrating to Delphi 10.2 Tokyo. Not sure if it was one of the components, or delphi itself, but with Tokyo everything works as it should :) Thank you for your help – rimes Jan 31 '19 at 08:59
  • Obviously I reported the success too early. After a windows Update (KB4480977) it got again slow (also under XE 10.2). Thats really frustrating :( – rimes Feb 05 '19 at 10:25
  • The strange thing is, when executed via service the request consumes up to 50% of the CPU when posted. When I pack my application in a VCL Forms Application (the same business logic) it takes up to 7% of the CPU (thats the behaviour when the patches are active ). Is there any way to tell my windows service to behave somehow different (or to set a parameter when compiling the application)? – rimes Feb 05 '19 at 12:30
  • @ArnaudBouchez - its not MSSQL. Installed Firebird on the problematic machine, but no change in response time :( – rimes Feb 05 '19 at 18:00

0 Answers0