LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-03-2017, 02:03 PM   #1
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
HTTP request-throttling that will work on all browsers?


We have a fairly-complicated routine that draws pictures on a web site. Trouble is, sometimes we get a hundred requests for pictures within one second's time, such that all of the Apache workers are now drawing pictures and no other requests will be serviced.

I need a simple solution (been looking at mod_qos) which works on Apache 2.4.18 with mpm_event ... and that will work on all browsers.

If too many requests are being sent at the same time for this particular URL, we need to send back a response that will cause the browser to try again in a few seconds ... on its own.

It would be even nicer if we had something that could "cherry pick" the requests in Apache's queue so that some requests could simply wait-a-bit.

This is an o-l-d straight CGI application.
 
Old 01-03-2017, 04:54 PM   #2
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Don't know about apache, but nginx has something called HttpLimitReq that can be used to delay requests. You can use it to delay specific (cherry pick) ones once exceeded a certain limit
Some explanation
 
Old 01-03-2017, 05:49 PM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
While I am certainly not opposed to using Nginix, my particular concern has nothing at all to do with "load balancing" or "attack prevention." Rather, in my dream-of-dreams, I would have a module (compatible with mpm_prefork) which could sift through the queue of requests, divide it into "lanes" e.g. by regular expressions, and impose more-intelligent queueing protocols on the request-selection process.

For example, "only so many requests in this 'lane' may be active at one instant."

I even picked out a name for it: mod_fastlane. But I have neither the time nor the expertise to write it.
 
Old 01-04-2017, 04:32 AM   #4
624867243@qq.com
Member
 
Registered: Nov 2015
Location: ShenZhen
Posts: 33
Blog Entries: 1

Rep: Reputation: Disabled
is there some error on apache log?
you can upload the apache log.
so wo can check the log to solve the question
 
Old 01-04-2017, 05:00 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP
Quote:
If too many requests are being sent at the same time for this particular URL, we need to send back a response that will cause the browser to try again in a few seconds ... on its own.
Perhaps you can use mod_security like this example.

Regards
 
Old 01-05-2017, 08:41 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Actually, it seems to me now that we need to shift some of this workload to an external job/work-queueing mechanism, such that the Apache workers no longer do the work, but instead queue it to a much-smarter workload management process, then (somehow ...) wait for a response.

Even the most-brief Internet search confirms that a plethora of such systems exist ... with suitably-cute names: "RabbitMQ," "Celery," and so on. (As, of course, I anticipated ...)
 
Old 01-06-2017, 06:33 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
I even picked out a name for it: mod_fastlane. But I have neither the time nor the expertise to write it.
Quote:
Originally Posted by sundialsvcs View Post
I'm thinking that you will probably wind up writing a small computer-program here . . .
Who dat?
 
Old 01-06-2017, 12:09 PM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
https://www.varnish-cache.org/ ?
 
Old 01-08-2017, 02:06 PM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659

Original Poster
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
No, what we truly need (and for a variety of things related to this system) is a true workload-management / background-job system that can be installed and run as a Ubuntu (LTS) service using an Ubuntu package.

By now we know more-or-less exactly what requests are "the bugaboo," and we know that our system is being flooded ... legitimately and in the normal course of web-site operations(!) ... with more concurrent requests "of a particular kind" than it can actually serve.

But, we've also got things ... related to the same system ... that truly are "batch jobs." And some of these have resource-availability-related queueing requirements such as what a "batch job" system would handle. At the same time we've got very fast, "FastCGI-like" requests that might arrive many hundreds or thousands per second. We need a solution that can do it all.

(Note: this is an "ancient, huge, troublesome and cantankerous ... but very profitable(!) ... 'straight-CGI' application" that runs quite well under mpm_event, and it always will be.)

I also need to know if and how it is possible for HTTP to "push" a request to a particular connected user. In other words, is it possible for the HTTP worker, having dispatched the request, to go off and do other things ... and for the web browser also to go off and do other things ... until the web browser is notified by some message that is pushed to it that the requested data is now available?

Or, since many of the pieces of data that are being generated in this way are images, can we somehow seamlessly insert an offline request processing stage into this process, without client-side JavaScript polling? And, without tying-up an HTTPD worker process for the duration? (Assume mpm_event).)

References to existing web-pages (and LQ posts!) that talk about similar scenarios and that describe (non-commercial) solutions are ... requested!

Last edited by sundialsvcs; 01-08-2017 at 02:14 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Log HTTP request mario.almeida Linux - Security 3 02-15-2011 10:59 AM
Do web browsers use Http socket interface? Marty21 Linux - Networking 1 02-18-2009 03:46 PM
Work-around for ISP bandwidth throttling? ghight Linux - Networking 5 10-17-2006 12:46 PM
http request mkamyar Linux - Software 5 08-30-2005 02:30 AM
Does throttling work on non mobile processors? kaltag Linux - Laptop and Netbook 1 01-31-2004 03:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration