LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > Under DDoS need assistance

Reply
 
Thread Tools Display Modes
  #21  
Old 07-28-2009, 08:20 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Usually, the dummy bots only request one URL, so the page is cached in memory by kernel, multiple CPU license wont cause higher disk I/O.
AIO will help when the I/O wait of your server is high.
I don't think CiscoGuard really help on this, so it is better off not using it.
Reply With Quote
  #22  
Old 08-02-2009, 08:16 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
How is your server coping with the attacks now?
Reply With Quote
  #23  
Old 08-05-2009, 10:38 AM
Bono Bono is offline
Senior Member
 
Join Date: Jan 2009
Posts: 75
It would be cool if LiteSpeed could work with CSF in banning clients that are establishing too many connections.
Reply With Quote
  #24  
Old 08-05-2009, 03:47 PM
MikeDVB MikeDVB is offline
Senior Member
 
Join Date: Jul 2009
Posts: 218
Quote:
Originally Posted by anewday View Post
How is your server coping with the attacks now?
We ended up null-routing one IP that was coming under about 15gbps of attack and we moved another client to a litespeed powered dedicated server that was receiving about 50mbps worth of SYN requests that Cisco Guard was failing to filter.
Reply With Quote
  #25  
Old 08-05-2009, 03:58 PM
anewday anewday is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 723
omg What was the load during the 50mbps sync attack and how many cpu license? I take it that lsws was able to fend it off.

Last edited by anewday; 08-05-2009 at 04:03 PM..
Reply With Quote
  #26  
Old 08-05-2009, 04:20 PM
MikeDVB MikeDVB is offline
Senior Member
 
Join Date: Jul 2009
Posts: 218
Quote:
Originally Posted by anewday View Post
omg What was the load during the 50mbps sync attack and how many cpu license? I take it that lsws was able to fend it off.
Load stayed low as I changed the site to 100% static but the issue was the kernel was ending up with a huge amount of orphaned tcp_sockets and eventually was running out of available connections.
Reply With Quote
  #27  
Old 09-07-2009, 04:16 PM
Bono Bono is offline
Senior Member
 
Join Date: Jan 2009
Posts: 75
Quote:
Originally Posted by felosi View Post
Install CSF and use the connection tracking feature, set ct_limit to 30 at 30 second interval. Litespeed cant do it all on its own. Also SYND is another helpful script but use only after csf has ran with ct for a while as it uses netstat and can lag your system

SYND - http://nix101.com/2007/07/21/syn-deflate/
csf - http://configserver.com/cp/csf.html

Also in lsws admin ? security

static requests -10
dynamic - 1

connection soft limit - 5
connection hard limit - 15

in my experience its best to disable smart keep alive, set keep alive timeout to 15, connection timeout to 30

Then you need to tune your tcp stack depending on how much ram you have.

Here is config I sue for servers with 8gb ram, its probably too much but ips should be getting blocked before using all this:
net.core.rmem_max = 184217728
net.ipv4.tcp_rmem = 4096 33554432 184217728
net.core.wmem_max = 184217728
net.ipv4.tcp_wmem = 4096 33554432 184217728
net.ipv4.tcp_mem = 8388608 16777216 184217728
net.core.optmem_max = 107108864
net.core.rmem_default = 10097152
net.core.rmem_default = 10097152
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_re cv = 30
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_w ait = 60
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wa it = 30
kernel.panic=5
net.netfilter.nf_conntrack_max = 5048576
net.nf_conntrack_max = 5048576
net.ipv4.netfilter.ip_conntrack_max = 5048576
From your experience why we should turn off smart keep alive? When i'm under attack I see i'm not getting many syn requests so I cannot kill it with your tool, my main problem is TIME_WAIT, so i'm looking into to somehow fix that.

Usually my server load is around .30 but today i'm under attack so my load is pretty high.

1 CLOSING
14 ESTABLISHED
3 FIN_WAIT1
17 FIN_WAIT2
1 LAST_ACK
66 LISTEN
623 TIME_WAIT

01:05:15 up 227 days, 21:29, 1 user, load average: 2.71, 2.31, 2.14
So TIME_WAIT connections are causing load of web server.
How do you handle this kind of situations?
I have already limited dynamic requests, soft and hard limit but that doesn't help with many connections, I got 20-30 ips that are according to netstat connected more than 20-80 times in TIME_WAIT state.
Reply With Quote
  #28  
Old 09-07-2009, 10:14 PM
felosi felosi is offline
Senior Member
 
Join Date: Jun 2007
Posts: 249
Adjusting your time_wait timeouts in systctl as I listed above will help. But Time wait is not important, you can just set the timeout lower for that. You dont need to track it.

I am also currently soliciting developers to work on a new idea I have, what we came up with was BARF - Block Apache Request Floods - This is for http get style attacks - http://nix101.com/2009/09/04/new-bar...or-get-floods/
or just www/nix101.com/barf for direct link.

Also
1 CLOSING
14 ESTABLISHED
3 FIN_WAIT1
17 FIN_WAIT2
1 LAST_ACK

Does not look like attack to me, even with the amount of time waits you have. If your server goes down udner those conditions something is very wrong, check dmesg for packet drop errors and such
Reply With Quote
  #29  
Old 09-08-2009, 01:07 AM
Bono Bono is offline
Senior Member
 
Join Date: Jan 2009
Posts: 75
Quote:
Originally Posted by felosi View Post
Adjusting your time_wait timeouts in systctl as I listed above will help. But Time wait is not important, you can just set the timeout lower for that. You dont need to track it.

I am also currently soliciting developers to work on a new idea I have, what we came up with was BARF - Block Apache Request Floods - This is for http get style attacks - http://nix101.com/2009/09/04/new-bar...or-get-floods/
or just www/nix101.com/barf for direct link.

Also
1 CLOSING
14 ESTABLISHED
3 FIN_WAIT1
17 FIN_WAIT2
1 LAST_ACK

Does not look like attack to me, even with the amount of time waits you have. If your server goes down udner those conditions something is very wrong, check dmesg for packet drop errors and such
It doesn't go down, just load is higher than usual, but when my sites are busy load peaks at 12 and this is how it looks like.

49 ESTABLISHED
25 FIN_WAIT1
17 FIN_WAIT2
3 LAST_ACK
66 LISTEN
2 SYN_RECV
1058 TIME_WAIT

Later on:
1 CLOSE_WAIT
1 CLOSING
76 ESTABLISHED
8 FIN_WAIT1
48 FIN_WAIT2
3 LAST_ACK
66 LISTEN
12 SYN_RECV
1736 TIME_WAIT
Is BARF replacement for your synd script?

Last edited by Bono; 09-08-2009 at 05:40 AM..
Reply With Quote
  #30  
Old 10-08-2009, 07:02 PM
MikeDVB MikeDVB is offline
Senior Member
 
Join Date: Jul 2009
Posts: 218
In a (long awaited) update - LiteSpeed was able to keep up however it wasn't able to do 100k requests/second + the normal daily requests that would ordinarily hit the server.

I moved this one site onto it's own dedicated server with LiteSpeed and it stayed online and very responsive although it was using around 2tb of bandwidth/day
Reply With Quote
Reply

Tags
anti-ddos

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:24 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.