glassfish v3 throttling

View: New views
8 Messages — Rating Filter:   Alert me  

glassfish v3 throttling

by Cam Bazz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

How can I throttle requests per ip, say, max 10 requests per ip, or
rather ip/useragent when I am using glassfish v3? I though grizzly had
some built in mechanisms for that, but I could not figure out how to
do it.

Best.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Oleksiy Stashok :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

> How can I throttle requests per ip, say, max 10 requests per ip, or
> rather ip/useragent when I am using glassfish v3? I though grizzly had
> some built in mechanisms for that, but I could not figure out how to
> do it.
AFAIK we don't have such a mechanism. You can add it by implementing  
custom HTTP com.sun.grizzly.util.Interceptor.

WBR,
Alexey.

>
> Best.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Cam Bazz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Oleksiy,

I am up to the challenge but I have no idea where to start. What is an
interceptor, is it something like filter.

The reason where I came up with this throttle thing is some people are
attacking my glassfish, like sending 2000 requests per second, and i
get an OOM and my glassfish crashes.

Best.



On Tue, Oct 27, 2009 at 11:47 AM, Oleksiy Stashok
<Oleksiy.Stashok@...> wrote:

> Hi,
>
>> How can I throttle requests per ip, say, max 10 requests per ip, or
>> rather ip/useragent when I am using glassfish v3? I though grizzly had
>> some built in mechanisms for that, but I could not figure out how to
>> do it.
>
> AFAIK we don't have such a mechanism. You can add it by implementing custom
> HTTP com.sun.grizzly.util.Interceptor.
>
> WBR,
> Alexey.
>
>>
>> Best.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Jeanfrancois Arcand-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Salut,

which GF version are you using?

Cam Bazz wrote:
> Hello Oleksiy,
>
> I am up to the challenge but I have no idea where to start. What is an
> interceptor, is it something like filter.
>
> The reason where I came up with this throttle thing is some people are
> attacking my glassfish, like sending 2000 requests per second, and i
> get an OOM and my glassfish crashes.

Oh! Can you share the server.log? The Interceptor API is defined here:

    * http://is.gd/4Euml

Mainly, this APi gets called after the request headers has been parsed.
That might be too late for you so that's why I would like to see some
stack trace I can help. It might be better to close connection as soon
as you accept them. In that case, you would like to extends the
TCPSelectorHandler:

   * http://is.gd/4EuBO

Specifically the onAccept method

   * http://is.gd/4EuDV

Now if we go that route I will need to do some work to allow you to
configure GF to use your TCPSelectorHandler. That's simple to do.

A+

--Jeanfrancois


>
> Best.
>
>
>
> On Tue, Oct 27, 2009 at 11:47 AM, Oleksiy Stashok
> <Oleksiy.Stashok@...> wrote:
>> Hi,
>>
>>> How can I throttle requests per ip, say, max 10 requests per ip, or
>>> rather ip/useragent when I am using glassfish v3? I though grizzly had
>>> some built in mechanisms for that, but I could not figure out how to
>>> do it.
>> AFAIK we don't have such a mechanism. You can add it by implementing custom
>> HTTP com.sun.grizzly.util.Interceptor.
>>
>> WBR,
>> Alexey.
>>
>>> Best.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Cam Bazz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Jean Francois,

I am using GlassFish v3 (build 47.4)

I also made the unfortunate mistake of using this in production server.... :)

Unfortunately, there is nothing in server log. It just says
out-of-memory error, then the server goes blind.

However, I do have a heap dump that I got with jmap, and now I am
trying to open it with jmap, but it is a 4gb heap dump, and i have 8gb
of mem in my box, and 8gb is not enough. I specified -mx12G and of
course it is running for 3 days now, but did not start the jhat server
yet. but still waiting.

I will read the api documents, and rewrite a mail later on.

Best Regards,
-C.A.

>
> Oh! Can you share the server.log? The Interceptor API is defined here:
>
>   * http://is.gd/4Euml
>
> Mainly, this APi gets called after the request headers has been parsed. That
> might be too late for you so that's why I would like to see some stack trace
> I can help. It might be better to close connection as soon as you accept
> them. In that case, you would like to extends the TCPSelectorHandler:
>
>  * http://is.gd/4EuBO
>
> Specifically the onAccept method
>
>  * http://is.gd/4EuDV
>
> Now if we go that route I will need to do some work to allow you to
> configure GF to use your TCPSelectorHandler. That's simple to do.
>
> A+
>
> --Jeanfrancois
>
>
>>
>> Best.
>>
>>
>>
>> On Tue, Oct 27, 2009 at 11:47 AM, Oleksiy Stashok
>> <Oleksiy.Stashok@...> wrote:
>>>
>>> Hi,
>>>
>>>> How can I throttle requests per ip, say, max 10 requests per ip, or
>>>> rather ip/useragent when I am using glassfish v3? I though grizzly had
>>>> some built in mechanisms for that, but I could not figure out how to
>>>> do it.
>>>
>>> AFAIK we don't have such a mechanism. You can add it by implementing
>>> custom
>>> HTTP com.sun.grizzly.util.Interceptor.
>>>
>>> WBR,
>>> Alexey.
>>>
>>>> Best.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Jeanfrancois Arcand-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Salut,

Cam Bazz wrote:
> Hello Jean Francois,
>
> I am using GlassFish v3 (build 47.4)
>
> I also made the unfortunate mistake of using this in production server.... :)

Can you update to a b68 to see if that still happens? Was it happening
before?

>
> Unfortunately, there is nothing in server log. It just says
> out-of-memory error, then the server goes blind.
>
> However, I do have a heap dump that I got with jmap, and now I am
> trying to open it with jmap, but it is a 4gb heap dump, and i have 8gb
> of mem in my box, and 8gb is not enough. I specified -mx12G and of
> course it is running for 3 days now, but did not start the jhat server
> yet. but still waiting.

If you can share the heap dump (or open port 7000) I'm sure I can help
with this.

Thanks


-- Jeanfrancois


>
> I will read the api documents, and rewrite a mail later on.
>
> Best Regards,
> -C.A.
>
>> Oh! Can you share the server.log? The Interceptor API is defined here:
>>
>>   * http://is.gd/4Euml
>>
>> Mainly, this APi gets called after the request headers has been parsed. That
>> might be too late for you so that's why I would like to see some stack trace
>> I can help. It might be better to close connection as soon as you accept
>> them. In that case, you would like to extends the TCPSelectorHandler:
>>
>>  * http://is.gd/4EuBO
>>
>> Specifically the onAccept method
>>
>>  * http://is.gd/4EuDV
>>
>> Now if we go that route I will need to do some work to allow you to
>> configure GF to use your TCPSelectorHandler. That's simple to do.
>>
>> A+
>>
>> --Jeanfrancois
>>
>>
>>> Best.
>>>
>>>
>>>
>>> On Tue, Oct 27, 2009 at 11:47 AM, Oleksiy Stashok
>>> <Oleksiy.Stashok@...> wrote:
>>>> Hi,
>>>>
>>>>> How can I throttle requests per ip, say, max 10 requests per ip, or
>>>>> rather ip/useragent when I am using glassfish v3? I though grizzly had
>>>>> some built in mechanisms for that, but I could not figure out how to
>>>>> do it.
>>>> AFAIK we don't have such a mechanism. You can add it by implementing
>>>> custom
>>>> HTTP com.sun.grizzly.util.Interceptor.
>>>>
>>>> WBR,
>>>> Alexey.
>>>>
>>>>> Best.
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>> For additional commands, e-mail: users-help@...
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Cam Bazz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Jean,

The heap map is 4GB. I was not able to jhat it. (my computer only has
8gb or ram).

when I specify for the jhat to use more then 8gb, it goes on virtual
memory, and it does not finish to open port 7000.

I will be migrating to b70 pretty soon.

Best.

On Wed, Oct 28, 2009 at 3:42 PM, Jeanfrancois Arcand
<Jeanfrancois.Arcand@...> wrote:

> Salut,
>
> Cam Bazz wrote:
>>
>> Hello Jean Francois,
>>
>> I am using GlassFish v3 (build 47.4)
>>
>> I also made the unfortunate mistake of using this in production server....
>> :)
>
> Can you update to a b68 to see if that still happens? Was it happening
> before?
>
>>
>> Unfortunately, there is nothing in server log. It just says
>> out-of-memory error, then the server goes blind.
>>
>> However, I do have a heap dump that I got with jmap, and now I am
>> trying to open it with jmap, but it is a 4gb heap dump, and i have 8gb
>> of mem in my box, and 8gb is not enough. I specified -mx12G and of
>> course it is running for 3 days now, but did not start the jhat server
>> yet. but still waiting.
>
> If you can share the heap dump (or open port 7000) I'm sure I can help with
> this.
>
> Thanks
>
>
> -- Jeanfrancois
>
>
>>
>> I will read the api documents, and rewrite a mail later on.
>>
>> Best Regards,
>> -C.A.
>>
>>> Oh! Can you share the server.log? The Interceptor API is defined here:
>>>
>>>  * http://is.gd/4Euml
>>>
>>> Mainly, this APi gets called after the request headers has been parsed.
>>> That
>>> might be too late for you so that's why I would like to see some stack
>>> trace
>>> I can help. It might be better to close connection as soon as you accept
>>> them. In that case, you would like to extends the TCPSelectorHandler:
>>>
>>>  * http://is.gd/4EuBO
>>>
>>> Specifically the onAccept method
>>>
>>>  * http://is.gd/4EuDV
>>>
>>> Now if we go that route I will need to do some work to allow you to
>>> configure GF to use your TCPSelectorHandler. That's simple to do.
>>>
>>> A+
>>>
>>> --Jeanfrancois
>>>
>>>
>>>> Best.
>>>>
>>>>
>>>>
>>>> On Tue, Oct 27, 2009 at 11:47 AM, Oleksiy Stashok
>>>> <Oleksiy.Stashok@...> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>>> How can I throttle requests per ip, say, max 10 requests per ip, or
>>>>>> rather ip/useragent when I am using glassfish v3? I though grizzly had
>>>>>> some built in mechanisms for that, but I could not figure out how to
>>>>>> do it.
>>>>>
>>>>> AFAIK we don't have such a mechanism. You can add it by implementing
>>>>> custom
>>>>> HTTP com.sun.grizzly.util.Interceptor.
>>>>>
>>>>> WBR,
>>>>> Alexey.
>>>>>
>>>>>> Best.
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>> For additional commands, e-mail: users-help@...
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>> For additional commands, e-mail: users-help@...
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: glassfish v3 throttling

by Jeanfrancois Arcand-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Cam Bazz wrote:
> Hello Jean,
>
> The heap map is 4GB. I was not able to jhat it. (my computer only has
> 8gb or ram).
>
> when I specify for the jhat to use more then 8gb, it goes on virtual
> memory, and it does not finish to open port 7000.
>
> I will be migrating to b70 pretty soon.

Thanks for the update. I would really like to make sure v3 FCS doesn't
suffer the problem. If you see such thing, I would like to find a way to
introspect you heap.bin.

A+

--Jeanfrancois

>
> Best.
>
> On Wed, Oct 28, 2009 at 3:42 PM, Jeanfrancois Arcand
> <Jeanfrancois.Arcand@...> wrote:
>> Salut,
>>
>> Cam Bazz wrote:
>>> Hello Jean Francois,
>>>
>>> I am using GlassFish v3 (build 47.4)
>>>
>>> I also made the unfortunate mistake of using this in production server....
>>> :)
>> Can you update to a b68 to see if that still happens? Was it happening
>> before?
>>
>>> Unfortunately, there is nothing in server log. It just says
>>> out-of-memory error, then the server goes blind.
>>>
>>> However, I do have a heap dump that I got with jmap, and now I am
>>> trying to open it with jmap, but it is a 4gb heap dump, and i have 8gb
>>> of mem in my box, and 8gb is not enough. I specified -mx12G and of
>>> course it is running for 3 days now, but did not start the jhat server
>>> yet. but still waiting.
>> If you can share the heap dump (or open port 7000) I'm sure I can help with
>> this.
>>
>> Thanks
>>
>>
>> -- Jeanfrancois
>>
>>
>>> I will read the api documents, and rewrite a mail later on.
>>>
>>> Best Regards,
>>> -C.A.
>>>
>>>> Oh! Can you share the server.log? The Interceptor API is defined here:
>>>>
>>>>  * http://is.gd/4Euml
>>>>
>>>> Mainly, this APi gets called after the request headers has been parsed.
>>>> That
>>>> might be too late for you so that's why I would like to see some stack
>>>> trace
>>>> I can help. It might be better to close connection as soon as you accept
>>>> them. In that case, you would like to extends the TCPSelectorHandler:
>>>>
>>>>  * http://is.gd/4EuBO
>>>>
>>>> Specifically the onAccept method
>>>>
>>>>  * http://is.gd/4EuDV
>>>>
>>>> Now if we go that route I will need to do some work to allow you to
>>>> configure GF to use your TCPSelectorHandler. That's simple to do.
>>>>
>>>> A+
>>>>
>>>> --Jeanfrancois
>>>>
>>>>
>>>>> Best.
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Oct 27, 2009 at 11:47 AM, Oleksiy Stashok
>>>>> <Oleksiy.Stashok@...> wrote:
>>>>>> Hi,
>>>>>>
>>>>>>> How can I throttle requests per ip, say, max 10 requests per ip, or
>>>>>>> rather ip/useragent when I am using glassfish v3? I though grizzly had
>>>>>>> some built in mechanisms for that, but I could not figure out how to
>>>>>>> do it.
>>>>>> AFAIK we don't have such a mechanism. You can add it by implementing
>>>>>> custom
>>>>>> HTTP com.sun.grizzly.util.Interceptor.
>>>>>>
>>>>>> WBR,
>>>>>> Alexey.
>>>>>>
>>>>>>> Best.
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>> For additional commands, e-mail: users-help@...
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>> For additional commands, e-mail: users-help@...
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...