Jump to content

Size of ISAPI DLL may be a problem if works as Standalone?


SergioFeitoza

Recommended Posts

I continue trying to deploy my code  Isap+Apache. It works very well as standalone and no  problem related to its size. It is a calculations code with many variables

For the ISAPI DLL I could deploy and make it work  using a “less heavy”  MainForm, where there is a much lower amount of variables. The other units as MainModule , ServerModule and LoginPage are exactly the same.  After many tests and without having compilation / build erros I continue  having  the ERROR 500 when I use the full code.

So, supposing that the reason for the ERROR 500 is the number of variables, I ask two questions:

a)       From the point of view of size, if it wors properly in standalone, should work well as ISAPI . The codes are exactly the same except for the “first line”

b)      Is there a way to increase the stack or something like this ?

Any suggestion is welcome. I think there is very few possibilities for the optimization of the code. The size of the DLL is around 20 MB

Link to comment
Share on other sites

a)       From the point of view of size, if it works properly in standalone, should work in  ISAPI  as well. The codes are exactly the same except for the “first line”
- You might have a lot of Standalones using different ports.  Have tried with 20 in the same cloudserver with just 2Gb ram. But just to see how much it could hold. Not a pratical approach.

b)      Is there a way to increase the stack or something like this ?
- Managing your forms help but just in large projects. See Best Practices in manual.

Any suggestion is welcome. I think there is very few possibilities for the optimization of the code. The size of the DLL is around 20 MB
- Using external images always. The stateful format (used in uniGUI, Intraweb) is not intended to work with thousands of concurrent conecctions. If this is your case. Other wise, performance problems is more related to DB and programmer skill, tuning and monitoring.

Link to comment
Share on other sites

7 hours ago, Fred Montier said:

a)       From the point of view of size, if it works properly in standalone, should work in  ISAPI  as well. The codes are exactly the same except for the “first line”
- You might have a lot of Standalones using different ports.  Have tried with 20 in the same cloudserver with just 2Gb ram. But just to see how much it could hold. Not a pratical approach.

b)      Is there a way to increase the stack or something like this ?
- Managing your forms help but just in large projects. See Best Practices in manual.

Any suggestion is welcome. I think there is very few possibilities for the optimization of the code. The size of the DLL is around 20 MB
- Using external images always. The stateful format (used in uniGUI, Intraweb) is not intended to work with thousands of concurrent conecctions. If this is your case. Other wise, performance problems is more related to DB and programmer skill, tuning and monitoring.

Thanks Fred  Your comments are clear. About the forms I am checking if it makes a positive effect to transfer some “calculations” to  units without forms.

Your comment about  “Using external images always” is quite  relevant in my code. Now I noticed that many of the figures are “internal” and actually they are many. I will check this.

My strategy will be, at first, to try deploying the code as it is now as a Windows Service and IIS. If I succeed, I stop. If I do not succeed, I will do the changes in figures and code.

I will post the results here.

Link to comment
Share on other sites

Images. when  internal, they work as resource. They will be extract to cache or temp folder and that takes time.

IN a large system (more than 50 forms, and 100 concurrent sessions),  you will see the difference in performance very clearly.

You will find more and ready suppont to IIS than to Apache, for obvious reasons. The Delphi community programming to web is full of misconceptions and nut heads (as taking linux seriously at this time and age when Windows is starting to take the heat by google and amazon with theirs new OS).

Link to comment
Share on other sites

Just now, Fred Montier said:

Images. when  internal, they work as resource. They will be extract to cache or temp folder and that takes time.

IN a large system (more than 50 forms, and 100 concurrent sessions),  you will see the difference in performance very clearly.

You will find more and ready suppont to IIS than to Apache, for obvious reasons. The Delphi community programming to web is full of misconceptions and nut heads (as taking linux seriously at this time and age when Windows is starting to take the heat by google and amazon with theirs new OS).

Thank and well understood Fred. II am working in these points just now. I will post in the next days

 

Link to comment
Share on other sites

Hello SergioFeitoza.

If you're running your environment with Apache, the error 500 generate a message log. Can you paste this message here?

To be clear, this error can be found in file "error.log". It is located inside C:\xampp\apache\logs, if using XAMPP as web stack (default instalation). If using XAMPP you can find the "error.log" inside Xampp console, clicking in the Apache's "Logs" button > Apache (error.log).

I've faced this error when trying to run an x86 ISAPI module inside an x64 compiled Apache.

The size o ISAPI is not a problem. When the apache receives the HTTP GET request, it just loads the ISAPI module into the memory and passes the request to it. So, if the size of the module is a problem, is in the OS context.

Link to comment
Share on other sites

56 minutes ago, Daniel Prado said:

Hello SergioFeitoza.

If you're running your environment with Apache, the error 500 generate a message log. Can you paste this message here?

To be clear, this error can be found in file "error.log". It is located inside C:\xampp\apache\logs, if using XAMPP as web stack (default instalation). If using XAMPP you can find the "error.log" inside Xampp console, clicking in the Apache's "Logs" button > Apache (error.log).

I've faced this error when trying to run an x86 ISAPI module inside an x64 compiled Apache.

The size o ISAPI is not a problem. When the apache receives the HTTP GET request, it just loads the ISAPI module into the memory and passes the request to it. So, if the size of the module is a problem, is in the OS context.

Dear Daniel Thank you very much for your time helping me . The log file is attached. I am  going step by step and the eror seems to be  in the MainForm or  ResultsForm or unit (without form)  U0D. Just to remember , it works well in standalone and I am using the same servermodule and mainmodule that is working wel in another code. I am now using only external images and the size of the dll is 16 Mb

logs.rar

Link to comment
Share on other sites

8 minutes ago, Daniel Prado said:

Good morning SergioFeitoza.

Unfortunately I'cant download the attach. The forum give me error code when trying to download it (Error Code 2C171/1). Can you paste the log here? If possible, clear the log before starting the Apache, so we will have a error focused log.

Hi Daniel  ... As I do not understand very well what is "clean the log before" let me try  to send the log file instaed of the rar  one. If you can not open please tell me and I put it in my site and inform you

The last line of the file says

" [Tue Aug 11 18:44:25.261716 2020] [isapi:error] [pid 6844:tid 1908] (OS 193)%1 it is not a valid Win32 app Win32 válido.  : AH02107: failed to load C:/swd/swd/index.dll  "     ( but I built as 64 bit)

error.log

64bit.png

Link to comment
Share on other sites

Thank you for the log entry.

The error occur because of the x86 ISAPI module running into an x64 compile Apache ISAPI module. 

You can fix it installing the XAMP 7.3.2 x86 (Link below) after removing your current version, then deploying an x86 (32-bit Windows) ISAPI module of your application.

Another way is to build your ISAPI Module with x64 Windows arch. But, Delphi lacks the correct support for this, and I do not know if UniGUI does.

Note: After Xampp version 7.3.2 the x86 support was leaved behind.

Xampp 7.3.2 x86: https://sourceforge.net/projects/xampp/files/XAMPP Windows/7.3.2/xampp-win32-7.3.2-0-VC15-installer.exe/download

Link to comment
Share on other sites

Just now, Daniel Prado said:

Thank you for the log entry.

The error occur because of the x86 ISAPI module running into an x64 compile Apache ISAPI module. 

You can fix it installing the XAMP 7.3.2 x86 (Link below) after removing your current version, then deploying an x86 (32-bit Windows) ISAPI module of your application.

Another way is to build your ISAPI Module with x64 Windows arch. But, Delphi lacks the correct support for this, and I do not know if UniGUI does.

Note: After Xampp version 7.3.2 the x86 support was leaved behind.

Xampp 7.3.2 x86: https://sourceforge.net/projects/xampp/files/XAMPP Windows/7.3.2/xampp-win32-7.3.2-0-VC15-installer.exe/download

Thank you Daniel

I will proceed as you menion and will inform after

Regards and thanks again

Link to comment
Share on other sites

Dear Daniel.

You found the error and the solution using Isapi + Xampp. As you wrote above, the error occurred because of the x86 ISAPI module running into an x64 compile Apache ISAPI module. Then I removed the 64 bits version and installed the XAMP 7.3.2 x86 . So, I went to the code and deployed as x86 (32-bit Windows) ISAPI module. Now it is running well in the local host (see the figure). Now I will clean some small parts and deploy in the web through my provider.

After the service is available in the web – I hope by next week – I will try to do the same with IIS and Windows. Actually, I did a fast trial with them this morning. However, your solution worked first.

Thanks to all of you which helped me açong these weeks , specialty to Daniel, Fred, Abaksoft and Silvio

Deployed.png

Link to comment
Share on other sites

Just now, Daniel Prado said:

Hello SergioFeitoza.

I'm happy to read this. Your software seens to be very interesting.

Kind Regards.

 

It is really a rare software in the electrical engineering field. With it working as a service, I will finally be able to dedicate most of my time to music production and writer activities (some info in my site cognitor.com.br   ) My Instagram is in the top of the page. Thanks again.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...