using terracotta for semaphors

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

using terracotta for semaphors

by hank williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have an idea, and I am wondering if it is practical.

I want to use TC as a distributed semaphor holder. The idea is that if
I say a particular resource is in use, then I dont want anyone else to
see it as being in use. My concern is the time between when I mark the
resource as being in use and the potential that someone else is
simultaneously marking it in use on a different server. How can I
handle this in TC?

Hank
--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by Taylor Gautier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
That is easy to do with Terracotta.  The same as you would do with normal Java - just use synchronized to protect your critical section.

The tutorials on the website should help you.  In particular, you want the locking related recipes:

http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource

There are no race conditions when using Terracotta.

----- Original Message -----
From: "hank williams" <hank777@...>
To: tc-users@...
Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
Subject: [tc-users] using terracotta for semaphors

I have an idea, and I am wondering if it is practical.

I want to use TC as a distributed semaphor holder. The idea is that if
I say a particular resource is in use, then I dont want anyone else to
see it as being in use. My concern is the time between when I mark the
resource as being in use and the potential that someone else is
simultaneously marking it in use on a different server. How can I
handle this in TC?

Hank
--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by Taylor Gautier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I also recently wrote a blog about this here:

http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html


----- Original Message -----
From: "Taylor Gautier" <tgautier@...>
To: tc-users@...
Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
Subject: Re: [tc-users] using terracotta for semaphors

That is easy to do with Terracotta.  The same as you would do with normal Java - just use synchronized to protect your critical section.

The tutorials on the website should help you.  In particular, you want the locking related recipes:

http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource

There are no race conditions when using Terracotta.

----- Original Message -----
From: "hank williams" <hank777@...>
To: tc-users@...
Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
Subject: [tc-users] using terracotta for semaphors

I have an idea, and I am wondering if it is practical.

I want to use TC as a distributed semaphor holder. The idea is that if
I say a particular resource is in use, then I dont want anyone else to
see it as being in use. My concern is the time between when I mark the
resource as being in use and the potential that someone else is
simultaneously marking it in use on a different server. How can I
handle this in TC?

Hank
--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________ tc-users mailing list tc-users@... http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by hank williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks.

One additional question. In this scenario, what are the performance
characteristics as the cluster size increases. I presume 10 is no
problem. What does it look like at 100, 1000, 10k.

Hank

On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
<tgautier@...> wrote:

> I also recently wrote a blog about this here:
> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>
> ----- Original Message -----
> From: "Taylor Gautier" <tgautier@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> That is easy to do with Terracotta.  The same as you would do with normal
> Java - just use synchronized to protect your critical section.
> The tutorials on the website should help you.  In particular, you want the
> locking related recipes:
> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
> There are no race conditions when using Terracotta.
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
> Subject: [tc-users] using terracotta for semaphors
>
> I have an idea, and I am wondering if it is practical.
>
> I want to use TC as a distributed semaphor holder. The idea is that if
> I say a particular resource is in use, then I dont want anyone else to
> see it as being in use. My concern is the time between when I mark the
> resource as being in use and the potential that someone else is
> simultaneously marking it in use on a different server. How can I
> handle this in TC?
>
> Hank
> --
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
> _______________________________________________ tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
>



--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by Taylor Gautier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
10,000 nodes? 

----- Original Message -----
From: "hank williams" <hank777@...>
To: tc-users@...
Sent: Thursday, January 8, 2009 8:42:57 AM GMT -08:00 US/Canada Pacific
Subject: Re: [tc-users] using terracotta for semaphors

Thanks.

One additional question. In this scenario, what are the performance
characteristics as the cluster size increases. I presume 10 is no
problem. What does it look like at 100, 1000, 10k.

Hank

On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
<tgautier@...> wrote:
> I also recently wrote a blog about this here:
> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>
> ----- Original Message -----
> From: "Taylor Gautier" <tgautier@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> That is easy to do with Terracotta.  The same as you would do with normal
> Java - just use synchronized to protect your critical section.
> The tutorials on the website should help you.  In particular, you want the
> locking related recipes:
> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
> There are no race conditions when using Terracotta.
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
> Subject: [tc-users] using terracotta for semaphors
>
> I have an idea, and I am wondering if it is practical.
>
> I want to use TC as a distributed semaphor holder. The idea is that if
> I say a particular resource is in use, then I dont want anyone else to
> see it as being in use. My concern is the time between when I mark the
> resource as being in use and the potential that someone else is
> simultaneously marking it in use on a different server. How can I
> handle this in TC?
>
> Hank
> --
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
> _______________________________________________ tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
>



--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by hank williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes. Is that an out of bounds question or something?

On 1/8/09, Taylor Gautier <tgautier@...> wrote:

> 10,000 nodes?
>
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 8:42:57 AM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> Thanks.
>
> One additional question. In this scenario, what are the performance
> characteristics as the cluster size increases. I presume 10 is no
> problem. What does it look like at 100, 1000, 10k.
>
> Hank
>
> On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
> <tgautier@...> wrote:
>> I also recently wrote a blog about this here:
>> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>>
>> ----- Original Message -----
>> From: "Taylor Gautier" <tgautier@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
>> Subject: Re: [tc-users] using terracotta for semaphors
>>
>> That is easy to do with Terracotta.  The same as you would do with normal
>> Java - just use synchronized to protect your critical section.
>> The tutorials on the website should help you.  In particular, you want the
>>
>> locking related recipes:
>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
>>
>> There are no race conditions when using Terracotta.
>> ----- Original Message -----
>> From: "hank williams" <hank777@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
>> Subject: [tc-users] using terracotta for semaphors
>>
>> I have an idea, and I am wondering if it is practical.
>>
>> I want to use TC as a distributed semaphor holder. The idea is that if
>> I say a particular resource is in use, then I dont want anyone else to
>> see it as being in use. My concern is the time between when I mark the
>> resource as being in use and the potential that someone else is
>> simultaneously marking it in use on a different server. How can I
>> handle this in TC?
>>
>> Hank
>> --
>> blog: whydoeseverythingsuck.com
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>> _______________________________________________ tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>>
>
>
>
> --
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>

--
Sent from my mobile device

blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Parent Message unknown Re: using terracotta for semaphors

by Taylor Gautier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Well, it's pretty unusual.  I think maybe Google has that many servers (or more), and probably Amazon.  Even IBM's Blue Gene, one of the largest supercomputers in the world "only" has 1,024 nodes.  As for commodity software products, there are not any (that I'm aware of) that are deployed to more than several thousand nodes, let alone 10,000.  Even different systems provide different characteristics from coherence to performance, so one system's 1000's of nodes cannot readily be compared to another system's 1000's of nodes.  So yes, it seems to me anyway that it's a bit of an academic question. :)

Anyway, Terracotta has been tested out to a few hundred nodes which is far and away beyond what most clusters are comprised of.  

Regarding the performance of locking in Terracotta, it is always O(1) since the locks are not "distributed" - all clients are connected to the Terracotta server array which manages locking.  In other words, the number of nodes does not affect the performance of locking.

Depending on the state of the lock, you can have one of three things happen:

1) You request the lock, and the node you are on already has the lock leased.  In this scenario, the lock acquire will be granted immediately with no network traffic.
2) You request the lock, and it is not leased to your local node, and it is not held anywhere else in the cluster.  Your node will be granted a lock lease.  There will be network traffic involved in the request/response to the server.
3) You request the lock, and it is held by another node.  In this case a lock recall will be issued to that node, when the lock is released it will go back to the server, and your node will acquire the lock.  There will be network traffic involved to the server as in #2, and you will have to wait for the release.

Based on this you can see that best case scenario your lock can be granted in microseconds, medium scenario in milliseconds, and worst case simply depends on your application.  In no cases does lock performance degrade with the number of nodes.

You must of course consider that lock contention will of course play a role in your performance.  If you have many nodes contending for a lock, then Terracotta will hand that lock out fairly (though not perfectly fair, since that tends to hurt throughput).  In the case of contention, your application, not Terracotta, needs to be tuned to be more concurrent.

We have lots of information on our website that pertains to detecting and tuning performance problems.  

http://www.terracotta.org/web/display/orgsite/Integration+Overview


----- Original Message -----
From: "hank williams" <hank777@...>
To: tc-users@...
Sent: Thursday, January 8, 2009 1:04:30 PM GMT -08:00 US/Canada Pacific
Subject: Re: [tc-users] using terracotta for semaphors

Yes. Is that an out of bounds question or something?

On 1/8/09, Taylor Gautier <tgautier@...> wrote:
> 10,000 nodes?
>
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 8:42:57 AM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> Thanks.
>
> One additional question. In this scenario, what are the performance
> characteristics as the cluster size increases. I presume 10 is no
> problem. What does it look like at 100, 1000, 10k.
>
> Hank
>
> On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
> <tgautier@...> wrote:
>> I also recently wrote a blog about this here:
>> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>>
>> ----- Original Message -----
>> From: "Taylor Gautier" <tgautier@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
>> Subject: Re: [tc-users] using terracotta for semaphors
>>
>> That is easy to do with Terracotta.  The same as you would do with normal
>> Java - just use synchronized to protect your critical section.
>> The tutorials on the website should help you.  In particular, you want the
>>
>> locking related recipes:
>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
>>
>> There are no race conditions when using Terracotta.
>> ----- Original Message -----
>> From: "hank williams" <hank777@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
>> Subject: [tc-users] using terracotta for semaphors
>>
>> I have an idea, and I am wondering if it is practical.
>>
>> I want to use TC as a distributed semaphor holder. The idea is that if
>> I say a particular resource is in use, then I dont want anyone else to
>> see it as being in use. My concern is the time between when I mark the
>> resource as being in use and the potential that someone else is
>> simultaneously marking it in use on a different server. How can I
>> handle this in TC?
>>
>> Hank
>> --
>> blog: whydoeseverythingsuck.com
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>> _______________________________________________ tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>>
>
>
>
> --
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>

--
Sent from my mobile device

blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by hank williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Taylor,

Thanks for the response. It is exactly what I needed.

While I cannot say how many servers we will actually need, our intent
is to build a truly horizontally scalable platform. Because we are
building a platform, meaning other people will build things on top of
what we are building, it is impossible to say how it will be stressed.
And because the platform needs to support not one application, but all
the applications that sit on top of it, we need to consider cumulative
load across all applications. If you think of what we are building as
a hosting platform, you might be able to imagine needing thousands, or
tens of thousands of servers. But the main question is really about
the dynamics of the scaling, the behavior from a mathematical
perspective, not a particular number of servers. Thinking in terms of
10,000 certainly helps me to understand the dynamics better than 10 to
100 servers.

Anyway, thanks again.

Regards,
Hank

On Thu, Jan 8, 2009 at 4:41 PM, Taylor Gautier
<tgautier@...> wrote:

> Well, it's pretty unusual.  I think maybe Google has that many servers (or
> more), and probably Amazon.  Even IBM's Blue Gene, one of the largest
> supercomputers in the world "only" has 1,024 nodes.  As for commodity
> software products, there are not any (that I'm aware of) that are deployed
> to more than several thousand nodes, let alone 10,000.  Even different
> systems provide different characteristics from coherence to performance, so
> one system's 1000's of nodes cannot readily be compared to another system's
> 1000's of nodes.  So yes, it seems to me anyway that it's a bit of an
> academic question. :)
> Anyway, Terracotta has been tested out to a few hundred nodes which is far
> and away beyond what most clusters are comprised of.
>
> Regarding the performance of locking in Terracotta, it is always O(1) since
> the locks are not "distributed" - all clients are connected to the
> Terracotta server array which manages locking.  In other words, the number
> of nodes does not affect the performance of locking.
> Depending on the state of the lock, you can have one of three things happen:
> 1) You request the lock, and the node you are on already has the lock
> leased.  In this scenario, the lock acquire will be granted immediately with
> no network traffic.
> 2) You request the lock, and it is not leased to your local node, and it is
> not held anywhere else in the cluster.  Your node will be granted a lock
> lease.  There will be network traffic involved in the request/response to
> the server.
> 3) You request the lock, and it is held by another node.  In this case a
> lock recall will be issued to that node, when the lock is released it will
> go back to the server, and your node will acquire the lock.  There will be
> network traffic involved to the server as in #2, and you will have to wait
> for the release.
> Based on this you can see that best case scenario your lock can be granted
> in microseconds, medium scenario in milliseconds, and worst case simply
> depends on your application.  In no cases does lock performance degrade with
> the number of nodes.
> You must of course consider that lock contention will of course play a role
> in your performance.  If you have many nodes contending for a lock, then
> Terracotta will hand that lock out fairly (though not perfectly fair, since
> that tends to hurt throughput).  In the case of contention, your
> application, not Terracotta, needs to be tuned to be more concurrent.
> We have lots of information on our website that pertains to detecting and
> tuning performance problems.
> http://www.terracotta.org/web/display/orgsite/Integration+Overview
>
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 1:04:30 PM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> Yes. Is that an out of bounds question or something?
>
> On 1/8/09, Taylor Gautier <tgautier@...> wrote:
>> 10,000 nodes?
>>
>> ----- Original Message -----
>> From: "hank williams" <hank777@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 8:42:57 AM GMT -08:00 US/Canada Pacific
>> Subject: Re: [tc-users] using terracotta for semaphors
>>
>> Thanks.
>>
>> One additional question. In this scenario, what are the performance
>> characteristics as the cluster size increases. I presume 10 is no
>> problem. What does it look like at 100, 1000, 10k.
>>
>> Hank
>>
>> On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
>> <tgautier@...> wrote:
>>> I also recently wrote a blog about this here:
>>> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>>>
>>> ----- Original Message -----
>>> From: "Taylor Gautier" <tgautier@...>
>>> To: tc-users@...
>>> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
>>> Subject: Re: [tc-users] using terracotta for semaphors
>>>
>>> That is easy to do with Terracotta.  The same as you would do with normal
>>> Java - just use synchronized to protect your critical section.
>>> The tutorials on the website should help you.  In particular, you want
>>> the
>>>
>>> locking related recipes:
>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
>>>
>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
>>>
>>> There are no race conditions when using Terracotta.
>>> ----- Original Message -----
>>> From: "hank williams" <hank777@...>
>>> To: tc-users@...
>>> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
>>> Subject: [tc-users] using terracotta for semaphors
>>>
>>> I have an idea, and I am wondering if it is practical.
>>>
>>> I want to use TC as a distributed semaphor holder. The idea is that if
>>> I say a particular resource is in use, then I dont want anyone else to
>>> see it as being in use. My concern is the time between when I mark the
>>> resource as being in use and the potential that someone else is
>>> simultaneously marking it in use on a different server. How can I
>>> handle this in TC?
>>>
>>> Hank
>>> --
>>> blog: whydoeseverythingsuck.com
>>> _______________________________________________
>>> tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>
>>> _______________________________________________ tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>> _______________________________________________
>>> tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>
>>>
>>
>>
>>
>> --
>> blog: whydoeseverythingsuck.com
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>
> --
> Sent from my mobile device
>
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
>



--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by Taylor Gautier :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hank,

That sounds good.  A typical approach to a problem like you describe would be to partition - if there is no reason for application A to share data with application B for instance, then you can setup two separate partitions one to host application A and one to host application B.

Of course depending on the usage patterns, that may not be necessary given the behavior of Terracotta.  You know your system better than I of course and can make those decisions better than I.


----- Original Message -----
From: "hank williams" <hank777@...>
To: tc-users@...
Sent: Friday, January 9, 2009 4:32:59 AM GMT -08:00 US/Canada Pacific
Subject: Re: [tc-users] using terracotta for semaphors

Taylor,

Thanks for the response. It is exactly what I needed.

While I cannot say how many servers we will actually need, our intent
is to build a truly horizontally scalable platform. Because we are
building a platform, meaning other people will build things on top of
what we are building, it is impossible to say how it will be stressed.
And because the platform needs to support not one application, but all
the applications that sit on top of it, we need to consider cumulative
load across all applications. If you think of what we are building as
a hosting platform, you might be able to imagine needing thousands, or
tens of thousands of servers. But the main question is really about
the dynamics of the scaling, the behavior from a mathematical
perspective, not a particular number of servers. Thinking in terms of
10,000 certainly helps me to understand the dynamics better than 10 to
100 servers.

Anyway, thanks again.

Regards,
Hank

On Thu, Jan 8, 2009 at 4:41 PM, Taylor Gautier
<tgautier@...> wrote:
> Well, it's pretty unusual.  I think maybe Google has that many servers (or
> more), and probably Amazon.  Even IBM's Blue Gene, one of the largest
> supercomputers in the world "only" has 1,024 nodes.  As for commodity
> software products, there are not any (that I'm aware of) that are deployed
> to more than several thousand nodes, let alone 10,000.  Even different
> systems provide different characteristics from coherence to performance, so
> one system's 1000's of nodes cannot readily be compared to another system's
> 1000's of nodes.  So yes, it seems to me anyway that it's a bit of an
> academic question. :)
> Anyway, Terracotta has been tested out to a few hundred nodes which is far
> and away beyond what most clusters are comprised of.
>
> Regarding the performance of locking in Terracotta, it is always O(1) since
> the locks are not "distributed" - all clients are connected to the
> Terracotta server array which manages locking.  In other words, the number
> of nodes does not affect the performance of locking.
> Depending on the state of the lock, you can have one of three things happen:
> 1) You request the lock, and the node you are on already has the lock
> leased.  In this scenario, the lock acquire will be granted immediately with
> no network traffic.
> 2) You request the lock, and it is not leased to your local node, and it is
> not held anywhere else in the cluster.  Your node will be granted a lock
> lease.  There will be network traffic involved in the request/response to
> the server.
> 3) You request the lock, and it is held by another node.  In this case a
> lock recall will be issued to that node, when the lock is released it will
> go back to the server, and your node will acquire the lock.  There will be
> network traffic involved to the server as in #2, and you will have to wait
> for the release.
> Based on this you can see that best case scenario your lock can be granted
> in microseconds, medium scenario in milliseconds, and worst case simply
> depends on your application.  In no cases does lock performance degrade with
> the number of nodes.
> You must of course consider that lock contention will of course play a role
> in your performance.  If you have many nodes contending for a lock, then
> Terracotta will hand that lock out fairly (though not perfectly fair, since
> that tends to hurt throughput).  In the case of contention, your
> application, not Terracotta, needs to be tuned to be more concurrent.
> We have lots of information on our website that pertains to detecting and
> tuning performance problems.
> http://www.terracotta.org/web/display/orgsite/Integration+Overview
>
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Thursday, January 8, 2009 1:04:30 PM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> Yes. Is that an out of bounds question or something?
>
> On 1/8/09, Taylor Gautier <tgautier@...> wrote:
>> 10,000 nodes?
>>
>> ----- Original Message -----
>> From: "hank williams" <hank777@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 8:42:57 AM GMT -08:00 US/Canada Pacific
>> Subject: Re: [tc-users] using terracotta for semaphors
>>
>> Thanks.
>>
>> One additional question. In this scenario, what are the performance
>> characteristics as the cluster size increases. I presume 10 is no
>> problem. What does it look like at 100, 1000, 10k.
>>
>> Hank
>>
>> On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
>> <tgautier@...> wrote:
>>> I also recently wrote a blog about this here:
>>> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>>>
>>> ----- Original Message -----
>>> From: "Taylor Gautier" <tgautier@...>
>>> To: tc-users@...
>>> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
>>> Subject: Re: [tc-users] using terracotta for semaphors
>>>
>>> That is easy to do with Terracotta.  The same as you would do with normal
>>> Java - just use synchronized to protect your critical section.
>>> The tutorials on the website should help you.  In particular, you want
>>> the
>>>
>>> locking related recipes:
>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
>>>
>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
>>>
>>> There are no race conditions when using Terracotta.
>>> ----- Original Message -----
>>> From: "hank williams" <hank777@...>
>>> To: tc-users@...
>>> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
>>> Subject: [tc-users] using terracotta for semaphors
>>>
>>> I have an idea, and I am wondering if it is practical.
>>>
>>> I want to use TC as a distributed semaphor holder. The idea is that if
>>> I say a particular resource is in use, then I dont want anyone else to
>>> see it as being in use. My concern is the time between when I mark the
>>> resource as being in use and the potential that someone else is
>>> simultaneously marking it in use on a different server. How can I
>>> handle this in TC?
>>>
>>> Hank
>>> --
>>> blog: whydoeseverythingsuck.com
>>> _______________________________________________
>>> tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>
>>> _______________________________________________ tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>> _______________________________________________
>>> tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>
>>>
>>
>>
>>
>> --
>> blog: whydoeseverythingsuck.com
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>
> --
> Sent from my mobile device
>
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
>



--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users

Re: using terracotta for semaphors

by hank williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jan 9, 2009 at 11:06 AM, Taylor Gautier
<tgautier@...> wrote:
> Hank,
> That sounds good.  A typical approach to a problem like you describe would
> be to partition - if there is no reason for application A to share data with
> application B for instance, then you can setup two separate partitions one
> to host application A and one to host application B.

Yes, one of the benefits of our system is the ability for broad data
sharing across users and applications. That doesnt mean partitioning
of some sort wont be employed, but it is not as simple as it would be
in a normal situation. Given the broad dynamics, understanding where
we can get away with *not* partitioning is helpful.

Hank

> Of course depending on the usage patterns, that may not be necessary given
> the behavior of Terracotta.  You know your system better than I of course
> and can make those decisions better than I.
>
> ----- Original Message -----
> From: "hank williams" <hank777@...>
> To: tc-users@...
> Sent: Friday, January 9, 2009 4:32:59 AM GMT -08:00 US/Canada Pacific
> Subject: Re: [tc-users] using terracotta for semaphors
>
> Taylor,
>
> Thanks for the response. It is exactly what I needed.
>
> While I cannot say how many servers we will actually need, our intent
> is to build a truly horizontally scalable platform. Because we are
> building a platform, meaning other people will build things on top of
> what we are building, it is impossible to say how it will be stressed.
> And because the platform needs to support not one application, but all
> the applications that sit on top of it, we need to consider cumulative
> load across all applications. If you think of what we are building as
> a hosting platform, you might be able to imagine needing thousands, or
> tens of thousands of servers. But the main question is really about
> the dynamics of the scaling, the behavior from a mathematical
> perspective, not a particular number of servers. Thinking in terms of
> 10,000 certainly helps me to understand the dynamics better than 10 to
> 100 servers.
>
> Anyway, thanks again.
>
> Regards,
> Hank
>
> On Thu, Jan 8, 2009 at 4:41 PM, Taylor Gautier
> <tgautier@...> wrote:
>> Well, it's pretty unusual.  I think maybe Google has that many servers (or
>> more), and probably Amazon.  Even IBM's Blue Gene, one of the largest
>> supercomputers in the world "only" has 1,024 nodes.  As for commodity
>> software products, there are not any (that I'm aware of) that are deployed
>> to more than several thousand nodes, let alone 10,000.  Even different
>> systems provide different characteristics from coherence to performance,
>> so
>> one system's 1000's of nodes cannot readily be compared to another
>> system's
>> 1000's of nodes.  So yes, it seems to me anyway that it's a bit of an
>> academic question. :)
>> Anyway, Terracotta has been tested out to a few hundred nodes which is far
>> and away beyond what most clusters are comprised of.
>>
>> Regarding the performance of locking in Terracotta, it is always O(1)
>> since
>> the locks are not "distributed" - all clients are connected to the
>> Terracotta server array which manages locking.  In other words, the number
>> of nodes does not affect the performance of locking.
>> Depending on the state of the lock, you can have one of three things
>> happen:
>> 1) You request the lock, and the node you are on already has the lock
>> leased.  In this scenario, the lock acquire will be granted immediately
>> with
>> no network traffic.
>> 2) You request the lock, and it is not leased to your local node, and it
>> is
>> not held anywhere else in the cluster.  Your node will be granted a lock
>> lease.  There will be network traffic involved in the request/response to
>> the server.
>> 3) You request the lock, and it is held by another node.  In this case a
>> lock recall will be issued to that node, when the lock is released it will
>> go back to the server, and your node will acquire the lock.  There will be
>> network traffic involved to the server as in #2, and you will have to wait
>> for the release.
>> Based on this you can see that best case scenario your lock can be granted
>> in microseconds, medium scenario in milliseconds, and worst case simply
>> depends on your application.  In no cases does lock performance degrade
>> with
>> the number of nodes.
>> You must of course consider that lock contention will of course play a
>> role
>> in your performance.  If you have many nodes contending for a lock, then
>> Terracotta will hand that lock out fairly (though not perfectly fair,
>> since
>> that tends to hurt throughput).  In the case of contention, your
>> application, not Terracotta, needs to be tuned to be more concurrent.
>> We have lots of information on our website that pertains to detecting and
>> tuning performance problems.
>> http://www.terracotta.org/web/display/orgsite/Integration+Overview
>>
>> ----- Original Message -----
>> From: "hank williams" <hank777@...>
>> To: tc-users@...
>> Sent: Thursday, January 8, 2009 1:04:30 PM GMT -08:00 US/Canada Pacific
>> Subject: Re: [tc-users] using terracotta for semaphors
>>
>> Yes. Is that an out of bounds question or something?
>>
>> On 1/8/09, Taylor Gautier <tgautier@...> wrote:
>>> 10,000 nodes?
>>>
>>> ----- Original Message -----
>>> From: "hank williams" <hank777@...>
>>> To: tc-users@...
>>> Sent: Thursday, January 8, 2009 8:42:57 AM GMT -08:00 US/Canada Pacific
>>> Subject: Re: [tc-users] using terracotta for semaphors
>>>
>>> Thanks.
>>>
>>> One additional question. In this scenario, what are the performance
>>> characteristics as the cluster size increases. I presume 10 is no
>>> problem. What does it look like at 100, 1000, 10k.
>>>
>>> Hank
>>>
>>> On Thu, Jan 8, 2009 at 11:06 AM, Taylor Gautier
>>> <tgautier@...> wrote:
>>>> I also recently wrote a blog about this here:
>>>> http://javathink.blogspot.com/2008/12/java-distributed-lock-manager.html
>>>>
>>>> ----- Original Message -----
>>>> From: "Taylor Gautier" <tgautier@...>
>>>> To: tc-users@...
>>>> Sent: Thursday, January 8, 2009 8:05:13 AM GMT -08:00 US/Canada Pacific
>>>> Subject: Re: [tc-users] using terracotta for semaphors
>>>>
>>>> That is easy to do with Terracotta.  The same as you would do with
>>>> normal
>>>> Java - just use synchronized to protect your critical section.
>>>> The tutorials on the website should help you.  In particular, you want
>>>> the
>>>>
>>>> locking related recipes:
>>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=locking
>>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=synchronized
>>>>
>>>>
>>>> http://www.terracotta.org/web/display/orgsite/Recipe?recipe=singleresource
>>>>
>>>> There are no race conditions when using Terracotta.
>>>> ----- Original Message -----
>>>> From: "hank williams" <hank777@...>
>>>> To: tc-users@...
>>>> Sent: Thursday, January 8, 2009 6:59:46 AM GMT -08:00 US/Canada Pacific
>>>> Subject: [tc-users] using terracotta for semaphors
>>>>
>>>> I have an idea, and I am wondering if it is practical.
>>>>
>>>> I want to use TC as a distributed semaphor holder. The idea is that if
>>>> I say a particular resource is in use, then I dont want anyone else to
>>>> see it as being in use. My concern is the time between when I mark the
>>>> resource as being in use and the potential that someone else is
>>>> simultaneously marking it in use on a different server. How can I
>>>> handle this in TC?
>>>>
>>>> Hank
>>>> --
>>>> blog: whydoeseverythingsuck.com
>>>> _______________________________________________
>>>> tc-users mailing list
>>>> tc-users@...
>>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>>
>>>> _______________________________________________ tc-users mailing list
>>>> tc-users@...
>>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>> _______________________________________________
>>>> tc-users mailing list
>>>> tc-users@...
>>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> blog: whydoeseverythingsuck.com
>>> _______________________________________________
>>> tc-users mailing list
>>> tc-users@...
>>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>>
>>
>> --
>> Sent from my mobile device
>>
>> blog: whydoeseverythingsuck.com
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>> _______________________________________________
>> tc-users mailing list
>> tc-users@...
>> http://lists.terracotta.org/mailman/listinfo/tc-users
>>
>>
>
>
>
> --
> blog: whydoeseverythingsuck.com
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
> _______________________________________________
> tc-users mailing list
> tc-users@...
> http://lists.terracotta.org/mailman/listinfo/tc-users
>
>



--
blog: whydoeseverythingsuck.com
_______________________________________________
tc-users mailing list
tc-users@...
http://lists.terracotta.org/mailman/listinfo/tc-users