FastCGI web development for harbour is finally here - more than 20 times faster than CGI

740 views
Skip to first unread message

Eric Lendvai

unread,
Nov 26, 2019, 6:48:54 AM11/26/19
to Harbour Users
Just pushed to https://github.com/EricLendvai/harbour_FastCGI the first version of the first FastCGI harbour program. 

It has full support to VSCODE debugging and is incredibly fast.
I get more than 300 responses per seconds on a single thread. I ran it for more than 55000 hits with no memory leaks.

FastCGI apps can keep tables open and SQL connections open between web page requests!!!

For now it run on Windows / Apache, compiled with MSVC 2019.

Guillermo Varona Silupú

unread,
Nov 27, 2019, 8:00:00 AM11/27/19
to harbou...@googlegroups.com
Hi Eric:
How it use?
Any example?
TIA
BR
GVARONAS

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/66aa6bec-62ff-472f-b33d-14c10eb1e6c0%40googlegroups.com.


--
Atentamente,
Ing. Guillermo Varona Silupú
Piura - Perú

xamm-inf

unread,
Nov 27, 2019, 8:42:42 AM11/27/19
to Harbour Users


El miércoles, 27 de noviembre de 2019, 14:00:00 (UTC+1), gvar...@hotmail.com escribió:
Hi Eric:
How it use?
Any example?
TIA
BR
GVARONAS

El mar., 26 nov. 2019 a las 6:48, Eric Lendvai (<ericl...@gmail.com>) escribió:
Just pushed to https://github.com/EricLendvai/harbour_FastCGI the first version of the first FastCGI harbour program. 

It has full support to VSCODE debugging and is incredibly fast.
I get more than 300 responses per seconds on a single thread. I ran it for more than 55000 hits with no memory leaks.

FastCGI apps can keep tables open and SQL connections open between web page requests!!!

For now it run on Windows / Apache, compiled with MSVC 2019.

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbou...@googlegroups.com.

Eric Lendvai

unread,
Nov 27, 2019, 1:00:33 PM11/27/19
to harbou...@googlegroups.com
I will create an article on Harbour.wiki with more explonation about FastCGI and apache configs. For me IIS was not very stable. 

Working on a mod_harbour.exe to allow mod_harbour user to use this Fastcgi implementation. 

Also will add more generic APIs to read settings. And deal with multI form data inputs, to handle input and file uploads.

At some point hope to convert to Mingw as well.

Fastcgi is not only faster but also more secure since you can run the exes under a particular authentication. And it can recover from crashes and not bring down the entire Web server app, lIke apache for example. 



Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/a7c6fbe4-28bb-4600-921f-e22ec7b7652a%40googlegroups.com.

Lailton Fernando Mariano

unread,
Nov 27, 2019, 4:28:18 PM11/27/19
to Harbour Users
Hi Eric,

How you can calculate the difference speed to say this information?

I have been using CGI for about 6 ~ 7 years and it works for me really fast without any problem.
so I am curious to see the difference and how you are doing this calculation.

You have mentioned too it keep connection with database opened if it is true. HOW it identify who users is using the database?
What is the logic involved behind server for it?

Thanks for share your informations with us. it is a good discussion :)

Regards,
Lailton

Domenico D'Oria

unread,
Nov 28, 2019, 11:47:29 AM11/28/19
to Harbour Users
Hi Eric

many thank's for your big effort, you made a great job.

some suggestions if i can

1) porting to linux ( ubuntu )
    because is faster than windows

2) porting to lighttpd
    because is faster than apache

so

ubuntu+lighttpd = 4 times faster than windows+apache

best wishes

Domenico

Roberto Borges

unread,
Nov 28, 2019, 2:19:00 PM11/28/19
to Harbour Users
TKS !!!

Eric Lendvai

unread,
Dec 2, 2019, 4:49:03 AM12/2/19
to Harbour Users
Hello Domenico,

I hope to have another commit this week.

Refactoring to be class based, and will have the necessary options to query input parameters, files and query strings.
WIll also have a first version of a mod_harbour.exe, that should later be a in place replacement / addon to Antonio's mod_harbour project. This should help with easier debugging and more stable environment for high traffic web sites.

I had tried to port the main lib to mingw, but could not do this yet. Hopping to get some help from Antonio Linares or other Mingw wizards :)
Once that port is done, it should be very easy to port to linux.

In regards to lighttpd, I am not very familiar with that server, but if it supports the FastCGI protocol, it should work, I only had problems of stability under IIS.

The new version I will commit later this week will makes it very easy to debug, and does not require Apache to be restarted. But all of my tools / batch commands, require the use of VSCODE.
So if you are not familiar with VSCODE, please see the article at https://harbour.wiki/index.asp?page=PublicArticles&mode=show&id=190401174818&sig=6893630672

Also to test speed you can use the tool I created: https://github.com/EricLendvai/WebsiteSpeedTest
Or use the https://jmeter.apache.org/  Requires Java and is a little tricky to setup, but is a pretty powerful tool.

Eric Lendvai

unread,
Feb 15, 2020, 6:03:59 AM2/15/20
to Harbour Users
Hello Domenico,

I have an alpha version of Harbour_FastCGI working on Lubuntu and apache.
But since debugging requires a web server to run in console mode, I will most likely have it working with lighttpd also, since it as a console mode (non service). 

The only thing I could not figure out yet is a good alternative for Windows DebugView on Unix. That is the easiest method to debug C code. VSCode already takes care of the Harbour (PRG) code.
Any suggestions  ?

Thanks, Eric



On Thursday, November 28, 2019 at 8:47:29 AM UTC-8, Domenico D'Oria wrote:

Domenico D'Oria

unread,
Feb 15, 2020, 5:31:23 PM2/15/20
to Harbour Users
Hi Eric

i'm not a c or gcc expert, but looking for a c debugger on linux this is probably a good start


this is the man page of gcc


if you want any help i could test your code on bibi2 ( my ubuntu 18.04.03 server ), 64 bits, harbour 3.2 with apache or with ligthtpd , choose which server i have to run, no matter how your code is, step by step ,error after error we will find the solution.

or if you want i can give you a free account with ssh access or x2go access ( you need the x2go lxde client on your windows 7,8,10 pc )

bibi2 have a raid 1, 2x500 gb sata drives, 12 gb ram and an i3 processor.with ups protection, harbour 3.2 last commit 64 bits

the editor is geany, which works in windows and also in linux, is a simple editor with block copy/paste feauture.

regards

domenico

Eric Lendvai

unread,
Feb 20, 2020, 4:25:45 AM2/20/20
to Harbour Users
Thanks Domenico,

I am focusing on debugging the prg code on linux. I will be using Antonino Perricone's VSCode for that (almost working).

Thank you for suggesting lighttpd !!!!

Running the echo website, on lubuntu with lighttpd, on a single thread I know get more than 2600 request per seconds.
With plain CGI I would top at 100 on Apache, 20 on IIS (Windows).
Linux is so much faster, and lighttpd makes it even faster!

I hope to be able to release documentation and code in the next 2 to 3 weeks.

Eric
Reply all
Reply to author
Forward
0 new messages