如何限制每秒PHP点击次数? [英] How do I limit my number of PHP hits per second?

查看:281
本文介绍了如何限制每秒PHP点击次数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保护自己,如果有快速连接的人锤击我的

网站。这不是拒绝服务攻击,而是离线下载(当然

,这些都没有显示他们在使用者中是离线下载者所以我不能

过滤它们)。我的主要问题是我的网站是PHP,所以如果他们锤击它,

它会获得所有PHP文件执行并压倒CPU。我希望能够在我的index.php每秒点击一定数量的点击后获得
,所以只需

拒绝。


我找不到怎么做。它可以在PHP,htaccess等中完成。


任何想法?

解决方案

"女" < no@spam.comkirjoitti

viestiss ?: uE ******************** @ bgtnsc05-news.ops.worldnet.att。 net ...


>我想保护自己,如果有快速连接的人锤击我的

网站。这不是拒绝服务攻击,而是离线下载



即使我没有处理这个具体问题,我也想通过询问这些来获得帮助

问题:


1)离线下载者带给phpinfo()的信息:



< blockquote> Nu< no@spam.comwrote:


我想保护自己,如果有快速连接的人锤击

我的

网站。这不是拒绝服务攻击,而是离线下载(

course

,这些都没有显示他们在useragent中是离线下载者所以我可以'$

过滤它们)。我的主要问题是我的网站是PHP,所以如果他们锤击它b / b
它会使所有PHP文件执行并压倒CPU。我想



能够在我的index.php每秒点击一定量后,所以

只是< br $> b $ b拒绝。


我找不到怎么做。可以在PHP,htaccess等中完成。



我会说这必须在服务器级别完成,PHP中的任何内容都会

仍然需要/吃相当多的资源。


我建议你在alt.apache.configuration上问这个吗?

-

Rik Wasmus


Nu写道:


我想保护自己,如果有人快速连接锤击我的

网站。这不是拒绝服务攻击,而是离线下载(当然

,这些都没有显示他们在使用者中是离线下载者所以我不能

过滤它们)。我的主要问题是我的网站是PHP,所以如果他们锤击它,

它会获得所有PHP文件执行并压倒CPU。我希望能够在我的index.php每秒点击一定数量的点击后获得
,所以只需

拒绝。


我找不到怎么做。它可以在PHP,htaccess等中完成。


有什么想法吗?



无法完成。你无法控制网络上的其他人

。你只能控制你的反应。


你对不诚实的人采取的任何措施,你也会对诚实的人采取

。为此,有一些服务出售

,他们很乐意向您收取数千美元的销售费用。每月为您提供数千美元的服务。还有一些

甚至可以帮助追踪你的滥用用户。


但你最好的选择是确保你有能力

处理峰值负载,并且超载的系统降低了优雅的价值。


I want to protect myself from if someone with a fast connection hammers my
site. It''s not denial of service attacks, but offline downloaders (of course
that don''t show they''re offline downloaders in the useragent so I can''t
filter them by that). My main issue is my site is PHP so if they hammer it,
it gets all the PHP files executing and overwhelms the CPU. I''d like to be
able to after a certain amount of hits on my index.php per second, so just
refuse.

I can''t find how to do that. Can it be done in PHP, htaccess, etc.

Any ideas?

解决方案

"Nu" <no@spam.comkirjoitti
viestiss?:uE********************@bgtnsc05-news.ops.worldnet.att.net...

>I want to protect myself from if someone with a fast connection hammers my
site. It''s not denial of service attacks, but offline downloaders

Even I have not dealt with this specific issue, I want help by asking these
questions:

1) What info offline downloaders bring to phpinfo():



Nu <no@spam.comwrote:

I want to protect myself from if someone with a fast connection hammers
my
site. It''s not denial of service attacks, but offline downloaders (of
course
that don''t show they''re offline downloaders in the useragent so I can''t
filter them by that). My main issue is my site is PHP so if they hammer
it,
it gets all the PHP files executing and overwhelms the CPU. I''d like to
be
able to after a certain amount of hits on my index.php per second, so
just
refuse.

I can''t find how to do that. Can it be done in PHP, htaccess, etc.

I''d say this would have to be done on server-level, anything in PHP would
still need/eat quite some resources.

May I suggest you ask this on alt.apache.configuration?
--
Rik Wasmus


Nu wrote:

I want to protect myself from if someone with a fast connection hammers my
site. It''s not denial of service attacks, but offline downloaders (of course
that don''t show they''re offline downloaders in the useragent so I can''t
filter them by that). My main issue is my site is PHP so if they hammer it,
it gets all the PHP files executing and overwhelms the CPU. I''d like to be
able to after a certain amount of hits on my index.php per second, so just
refuse.

I can''t find how to do that. Can it be done in PHP, htaccess, etc.

Any ideas?

Can''t be done. You cannot control what other people on the web
do. You can only control how you react.

Any measure you take against the dishonest folks, you also take
against the honest ones. To that end, there are services out
there who will gladly charge you thousands of dollars to sell
you service packages for several thousand per month. And some
of those might even help to track down your abusive user.

But your best bet is to just make sure you have capacity to
handle peak loads, and that overloaded systems throttle down
gracefully.


这篇关于如何限制每秒PHP点击次数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆