What is the extension of Fastcgi – Rebol in FCGI settings?

I plan to write a pretty good web application in Rebol (currently using CGI on Apache 2), but the initial performance test was very frustrating. When I was on the application When running the apache benchmark, I get 4-5 requests/sec. I want to know if anyone else has had similar issues and if FastCGI really helps them.

Afaik and Rebol only support FastCGI in Command and SDK versions. Since R3 is open sourced, will it change soon?

I have been using the FastCGI device in Rebol for some time, so I can’t do well Answer the first question carefully, but I can help to solve your second question, although you may not like it.

No one has recreated fastcgi for R3: // The scheme. I said “Re-create” Because R3 has a completely different port model from R2, the port scheme is not portable at all between the two platforms. In addition, the R2/Command port scheme is built-in native code, even if it is open source, it cannot Ported to R3 because the system model of R3 is also different. And regardless of its portability, R2 contains a lot of commercially licensed code, and Rebol Technologies has no right to open source-almost all the code that can be opened has already entered R3. Therefore, if it is Doesn’t exist, it’s safe to assume that it’s not compatible or open at all.

Use the new fastcgi behind the R3 model: //The solution, starting from R3, will be faster and easier to start from scratch. Even if we have it, The R2 source that can help the most is to document the FastCGI protocol, and the AFAIK protocol is better documented elsewhere. In this case, it may be a good idea to establish a host port optimized for such things. This is in R3 It’s easier to implement in the middle.

On the bright side, I remember that the FastCGI protocol is not difficult to do, and the new R3 port model is much better for this type of thing, so it may not be too Difficult. If we are lucky, all of this can be done in user code that only runs on the regular R3 interpreter, without host code adjustments. So the news is not necessarily that bad.

Now try to answer you The first question: It depends.

It depends on what you want to do and how you set it up. CGI has the overhead of starting the process every time, so only when the process startup overhead is significantly less than It will be fast when the rest of the overhead of the request (such as file system or database access) is requested. Rebol, especially R2, has a lot of process startup overhead, because it is an interpreter, and it has some built-in interpretation code at startup Loading. You can minimize the startup overhead by using the SDK to create an application with only the code you need, but it still may not help in your specific situation (don’t know what you are trying to do).

FastCGI is a way to get rid of the overhead process by running an out-of-process application server instead of starting a new process for each request. For things like Rebol that have significant process startup overhead, the cost savings are equally important.

One thing you need to consider The thing is that most of R2 has a single-threaded per-process model, so if you want to handle multiple concurrent requests, you must partially execute them in the same process (such as Node.js) or let FastCGI allocate more A server process to handle multiple requests independently, or both. If this prospect is daunting, be sure to consult a Rebol expert, or just set up FastCGI to start more app servers running at the same time.

< p>Therefore, the number of requests that can be executed per second using FastCGI settings depends on how you configure FastCGI, how you write FastCGI handler code, and the amount of work and workload requested to be performed.

Although you know you Receive 4-5 requests per second in CGI mode. That’s very slow. In the worst case, Rebol’s startup overhead is not that slow. This means that your requests are either done a lot or you don’t have enough RAM to run multiple CGI processes, or your CGI is not properly configured. I’m not sure that FastCGI can help in this situation like using better hardware or better configuring Apache. Nevertheless, please make sure you have Enough FastCGI worker processes and write handlers to handle multiple requests at the same time, and you will save as much overhead as possible.

Good luck!

I plan to write a pretty good web application in Rebol (currently using CGI on Apache 2), but the initial performance test was very frustrating. When I When running the apache benchmark on the application, I get 4-5 requests/sec. I want to know if anyone else has had similar issues and if FastCGI really helps them.

Afaik and Rebol only support FastCGI in Command and SDK versions. Since R3 is open sourced, will it change soon?

I have been using the FastCGI device in Rebol for some time, so I can’t answer the first question well, but I can help with it Your second question, although you may not like it.

No one has recreated fastcgi for R3: // scheme. I said “recreate” because R3 has completely different from R2 Port model, so the port scheme is not portable at all between the two platforms. In addition, the R2/Command port scheme is built-in native code, even if it is open source, it cannot be ported to R3 because the system model of R3 is also different. And regardless of its portability, R2 contains a lot of commercially licensed code, and Rebol Technologies has no right to open source-almost all the code that can be opened has entered R3. Therefore, if it does not exist, it is safe to assume that it is not compatible at all or Cannot be opened.

Use the new fastcgi behind the R3 model: //The solution, starting from R3, will be faster and easier to start from scratch. Even if we have it, the R2 source can help the most is to record the FastCGI protocol, The AFAIK protocol is better documented elsewhere. In this case, it may be a good idea to establish a host port optimized for such things, which is easier to implement in R3.

On the bright side, I remember that the FastCGI protocol is not difficult to do, and the new R3 port model is much better for this kind of things, so it may not be too difficult to start from scratch. If we are lucky, all of this can be done in It is only done in the user code running on the regular R3 interpreter, without host code adjustments. So the news is not necessarily so bad.

Now try to answer your first question: it depends.

p>

It depends on what you want to do and how you set it up. CGI has the overhead of starting the process every time, so only when the process startup overhead is significantly less than the rest of the request (such as file system or database access) Rebol, especially R2, has a lot of process startup overhead, because it is an interpreter, and it has some built-in interpretation code to load at startup. You can only use what you need by using the SDK The code creates an application to minimize startup overhead, but still may not help in your particular situation (don’t know what you’re trying to do).

FastCGI is a way of running an out-of-process application server instead of A way to start a new process for each request to get rid of the overhead process. For something like Rebol that has significant process startup overhead, the cost savings are equally important.

One thing you need to consider is Most of R2 has a single-threaded per-process model, so if you want to handle multiple concurrent requests, you must partially execute them in the same process (e.g. Node).js) or let FastCGI allocate multiple server processes to handle multiple requests independently, or both. If this prospect is daunting, be sure to consult a Rebol expert, or just set FastCGI to start more The app server runs at the same time.

Therefore, the number of requests that can be executed per second using FastCGI settings depends on how you configure FastCGI, how you write FastCGI handler code, and the amount of work and workload requested to perform.< /p>

Although you know you receive 4-5 requests per second in CGI mode. That’s very slow. In the worst case, Rebol’s startup overhead is not that slow. This means your request Either you do a lot, or you don’t have enough RAM to run multiple CGI processes, or your CGI is not properly configured. I’m not sure how FastCGI can help in this situation is like using better hardware or better configuration Same as Apache. Nevertheless, please make sure you have enough FastCGI worker processes and write handlers to handle multiple requests at the same time, and you will save as much overhead as possible.

Good luck!

Leave a Comment

Your email address will not be published.