You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Chris Morgan <ch...@gmail.com> on 2011/02/05 02:42:36 UTC

slow c# server under mono

Hello.

I was running some tests to evaluate using mono to run a c# thrift
server. I created a simple application that passes blobs to the server
and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
here

>From testing I see:

cpp client -> c# server (mono 2.6) ~30 messages/sec
cpp client -> c# server (mono 2.11) ~30 messages/sec
cpp client -> cpp server ~30k messages/sec

The rates are the same whether or not the blob is 50 bytes or 5000 bytes.

For my particular use 30 messages a second is a huge bottleneck. Has
anyone else seen this kind of behavior? Anyone know how to fix it?

Chris

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
Yep. You guys have been great. One of the best mailing lists/dev lists
I've been on in a while. Very quick responses.

When I set Socket.NoDelay = true; in the TServerSocket I was able to
improve from the original ~30 messages / sec to ~11k messages / sec.

Still slow compared to using cpp on both sides of the link, that got
me 30k msg/sec but 11k is fine with me and the other transport
mechanisms might help.

Chris


On Mon, Feb 7, 2011 at 5:10 PM, Diego Jancic <ja...@gmail.com> wrote:
> Chris, were you able to make it work fast?
>
> On Mon, Feb 7, 2011 at 18:55, Chris Morgan <ch...@gmail.com> wrote:
>
>> Hi Jonathan.
>>
>> I see two issues:
>>
>> 1. How is ANYONE going to know that they will get 1000x the
>> performance with c#/mono(maybe even under ms .net) if they use
>> TFramedTransport vs. TServerSocket?
>>
>> 2. If the right thing is to use TFramedTransport then why not remove
>> TCP_NODELAY from java, cpp and whatever other platforms that set it?
>>
>> 3. If people want to keep TCP_NODELAY on for java and cpp then why not
>> enable it for c# to make it the same as the rest?
>>
>> Chris
>>
>>
>>
>> On Mon, Feb 7, 2011 at 4:51 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>> > You're right, it doesn't set nodelay. Alexey's analysis was that "If
>> > TFramedTransport used just one write() call per frame, there is no
>> > need for setNoTcpDelay."
>> >
>> > I don't know if he was right or not but it was a deliberate choice and
>> > not an oversight.
>> >
>> > On Mon, Feb 7, 2011 at 3:08 PM, Chris Morgan <ch...@gmail.com> wrote:
>> >> Hi Bryan.
>> >>
>> >> Actually haven't heard this before. Just started using thrift a few
>> >> days ago. I'll gladly try that for additional performance.
>> >>
>> >> I'd also like to resolve the issue for future users that may consider
>> >> using thrift with mono and abandon the idea when they get 30 messages
>> >> /sec.
>> >>
>> >> Shouldn't the c# TServerSocket work like the cpp and java ones do in
>> >> terms of disabling nagle?
>> >>
>> >> Chris
>> >>
>> >>
>> >>
>> >> On Mon, Feb 7, 2011 at 4:05 PM, Bryan Duxbury <br...@rapleaf.com>
>> wrote:
>> >>> You're probably tired of hearing this already, but please, please use
>> >>> buffered or framed transport. It will make your servers and clients
>> >>> noticeably faster in a lot of cases.
>> >>>
>> >>> On Mon, Feb 7, 2011 at 12:48 PM, Chris Morgan <ch...@gmail.com>
>> wrote:
>> >>>
>> >>>> Hi Jonathan.
>> >>>>
>> >>>> If it were committed wouldn't it be present in svn trunk? I'm using
>> >>>> svn trunk because I was hoping it had been fixed since the last
>> >>>> release.
>> >>>>
>> >>>> I looked at the commit, c1063966, and I don't see any mention of
>> >>>> disabling nodelay and the changes are modifying
>> >>>> src/Transport/TFramedTransport.cs
>> >>>>
>> >>>> My server code looks like:
>> >>>>
>> >>>>                var ourProcessor = new OurProcessor();
>> >>>>                var processor = new
>> TheProcessor.Processor(ourProcessor);
>> >>>>                TServerTransport serverTransport = new
>> TServerSocket(9090);
>> >>>>                TServer server = new TSimpleServer(processor,
>> >>>> serverTransport);
>> >>>>
>> >>>> So I'm not sure how the changes made to TFramedTransport would be
>> >>>> affecting TServerSocket since they don't seem connected.
>> >>>>
>> >>>> Chris
>> >>>>
>> >>>>
>> >>>> On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com>
>> wrote:
>> >>>> > Read the ticket you got the patch from -- it's been committed for
>> the
>> >>>> > next release.
>> >>>> >
>> >>>> > On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com>
>> wrote:
>> >>>> >> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com>
>> >>>> wrote:
>> >>>> >>> I just tested it out and setting NoDelay on the socket brought the
>> >>>> >>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
>> >>>> >>> now.
>> >>>> >>>
>> >>>> >>> What now? It looks like the guy that fixed the issue reported by
>> >>>> >>> Jonathan says the solution is to used a frame transport? It still
>> >>>> >>> looks like this is an issue with whatever the default transport
>> is,
>> >>>> >>> TServerSocket I guess?
>> >>>> >>>
>> >>>> >>> Chris
>> >>>> >>>
>> >>>> >>
>> >>>> >> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c#
>> do
>> >>>> >> what cpp and java do?
>> >>>> >>
>> >>>> >> Chris
>> >>>> >>
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > --
>> >>>> > Jonathan Ellis
>> >>>> > Project Chair, Apache Cassandra
>> >>>> > co-founder of DataStax, the source for professional Cassandra
>> support
>> >>>> > http://www.datastax.com
>> >>>> >
>> >>>>
>> >>>
>> >>
>> >
>> >
>> >
>> > --
>> > Jonathan Ellis
>> > Project Chair, Apache Cassandra
>> > co-founder of DataStax, the source for professional Cassandra support
>> > http://www.datastax.com
>> >
>>
>

Re: slow c# server under mono

Posted by Diego Jancic <ja...@gmail.com>.
Chris, were you able to make it work fast?

On Mon, Feb 7, 2011 at 18:55, Chris Morgan <ch...@gmail.com> wrote:

> Hi Jonathan.
>
> I see two issues:
>
> 1. How is ANYONE going to know that they will get 1000x the
> performance with c#/mono(maybe even under ms .net) if they use
> TFramedTransport vs. TServerSocket?
>
> 2. If the right thing is to use TFramedTransport then why not remove
> TCP_NODELAY from java, cpp and whatever other platforms that set it?
>
> 3. If people want to keep TCP_NODELAY on for java and cpp then why not
> enable it for c# to make it the same as the rest?
>
> Chris
>
>
>
> On Mon, Feb 7, 2011 at 4:51 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> > You're right, it doesn't set nodelay. Alexey's analysis was that "If
> > TFramedTransport used just one write() call per frame, there is no
> > need for setNoTcpDelay."
> >
> > I don't know if he was right or not but it was a deliberate choice and
> > not an oversight.
> >
> > On Mon, Feb 7, 2011 at 3:08 PM, Chris Morgan <ch...@gmail.com> wrote:
> >> Hi Bryan.
> >>
> >> Actually haven't heard this before. Just started using thrift a few
> >> days ago. I'll gladly try that for additional performance.
> >>
> >> I'd also like to resolve the issue for future users that may consider
> >> using thrift with mono and abandon the idea when they get 30 messages
> >> /sec.
> >>
> >> Shouldn't the c# TServerSocket work like the cpp and java ones do in
> >> terms of disabling nagle?
> >>
> >> Chris
> >>
> >>
> >>
> >> On Mon, Feb 7, 2011 at 4:05 PM, Bryan Duxbury <br...@rapleaf.com>
> wrote:
> >>> You're probably tired of hearing this already, but please, please use
> >>> buffered or framed transport. It will make your servers and clients
> >>> noticeably faster in a lot of cases.
> >>>
> >>> On Mon, Feb 7, 2011 at 12:48 PM, Chris Morgan <ch...@gmail.com>
> wrote:
> >>>
> >>>> Hi Jonathan.
> >>>>
> >>>> If it were committed wouldn't it be present in svn trunk? I'm using
> >>>> svn trunk because I was hoping it had been fixed since the last
> >>>> release.
> >>>>
> >>>> I looked at the commit, c1063966, and I don't see any mention of
> >>>> disabling nodelay and the changes are modifying
> >>>> src/Transport/TFramedTransport.cs
> >>>>
> >>>> My server code looks like:
> >>>>
> >>>>                var ourProcessor = new OurProcessor();
> >>>>                var processor = new
> TheProcessor.Processor(ourProcessor);
> >>>>                TServerTransport serverTransport = new
> TServerSocket(9090);
> >>>>                TServer server = new TSimpleServer(processor,
> >>>> serverTransport);
> >>>>
> >>>> So I'm not sure how the changes made to TFramedTransport would be
> >>>> affecting TServerSocket since they don't seem connected.
> >>>>
> >>>> Chris
> >>>>
> >>>>
> >>>> On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com>
> wrote:
> >>>> > Read the ticket you got the patch from -- it's been committed for
> the
> >>>> > next release.
> >>>> >
> >>>> > On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com>
> wrote:
> >>>> >> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com>
> >>>> wrote:
> >>>> >>> I just tested it out and setting NoDelay on the socket brought the
> >>>> >>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
> >>>> >>> now.
> >>>> >>>
> >>>> >>> What now? It looks like the guy that fixed the issue reported by
> >>>> >>> Jonathan says the solution is to used a frame transport? It still
> >>>> >>> looks like this is an issue with whatever the default transport
> is,
> >>>> >>> TServerSocket I guess?
> >>>> >>>
> >>>> >>> Chris
> >>>> >>>
> >>>> >>
> >>>> >> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c#
> do
> >>>> >> what cpp and java do?
> >>>> >>
> >>>> >> Chris
> >>>> >>
> >>>> >
> >>>> >
> >>>> >
> >>>> > --
> >>>> > Jonathan Ellis
> >>>> > Project Chair, Apache Cassandra
> >>>> > co-founder of DataStax, the source for professional Cassandra
> support
> >>>> > http://www.datastax.com
> >>>> >
> >>>>
> >>>
> >>
> >
> >
> >
> > --
> > Jonathan Ellis
> > Project Chair, Apache Cassandra
> > co-founder of DataStax, the source for professional Cassandra support
> > http://www.datastax.com
> >
>

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
Hi Jonathan.

I see two issues:

1. How is ANYONE going to know that they will get 1000x the
performance with c#/mono(maybe even under ms .net) if they use
TFramedTransport vs. TServerSocket?

2. If the right thing is to use TFramedTransport then why not remove
TCP_NODELAY from java, cpp and whatever other platforms that set it?

3. If people want to keep TCP_NODELAY on for java and cpp then why not
enable it for c# to make it the same as the rest?

Chris



On Mon, Feb 7, 2011 at 4:51 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> You're right, it doesn't set nodelay. Alexey's analysis was that "If
> TFramedTransport used just one write() call per frame, there is no
> need for setNoTcpDelay."
>
> I don't know if he was right or not but it was a deliberate choice and
> not an oversight.
>
> On Mon, Feb 7, 2011 at 3:08 PM, Chris Morgan <ch...@gmail.com> wrote:
>> Hi Bryan.
>>
>> Actually haven't heard this before. Just started using thrift a few
>> days ago. I'll gladly try that for additional performance.
>>
>> I'd also like to resolve the issue for future users that may consider
>> using thrift with mono and abandon the idea when they get 30 messages
>> /sec.
>>
>> Shouldn't the c# TServerSocket work like the cpp and java ones do in
>> terms of disabling nagle?
>>
>> Chris
>>
>>
>>
>> On Mon, Feb 7, 2011 at 4:05 PM, Bryan Duxbury <br...@rapleaf.com> wrote:
>>> You're probably tired of hearing this already, but please, please use
>>> buffered or framed transport. It will make your servers and clients
>>> noticeably faster in a lot of cases.
>>>
>>> On Mon, Feb 7, 2011 at 12:48 PM, Chris Morgan <ch...@gmail.com> wrote:
>>>
>>>> Hi Jonathan.
>>>>
>>>> If it were committed wouldn't it be present in svn trunk? I'm using
>>>> svn trunk because I was hoping it had been fixed since the last
>>>> release.
>>>>
>>>> I looked at the commit, c1063966, and I don't see any mention of
>>>> disabling nodelay and the changes are modifying
>>>> src/Transport/TFramedTransport.cs
>>>>
>>>> My server code looks like:
>>>>
>>>>                var ourProcessor = new OurProcessor();
>>>>                var processor = new TheProcessor.Processor(ourProcessor);
>>>>                TServerTransport serverTransport = new TServerSocket(9090);
>>>>                TServer server = new TSimpleServer(processor,
>>>> serverTransport);
>>>>
>>>> So I'm not sure how the changes made to TFramedTransport would be
>>>> affecting TServerSocket since they don't seem connected.
>>>>
>>>> Chris
>>>>
>>>>
>>>> On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>>>> > Read the ticket you got the patch from -- it's been committed for the
>>>> > next release.
>>>> >
>>>> > On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com> wrote:
>>>> >> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com>
>>>> wrote:
>>>> >>> I just tested it out and setting NoDelay on the socket brought the
>>>> >>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
>>>> >>> now.
>>>> >>>
>>>> >>> What now? It looks like the guy that fixed the issue reported by
>>>> >>> Jonathan says the solution is to used a frame transport? It still
>>>> >>> looks like this is an issue with whatever the default transport is,
>>>> >>> TServerSocket I guess?
>>>> >>>
>>>> >>> Chris
>>>> >>>
>>>> >>
>>>> >> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
>>>> >> what cpp and java do?
>>>> >>
>>>> >> Chris
>>>> >>
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Jonathan Ellis
>>>> > Project Chair, Apache Cassandra
>>>> > co-founder of DataStax, the source for professional Cassandra support
>>>> > http://www.datastax.com
>>>> >
>>>>
>>>
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>

Re: slow c# server under mono

Posted by Jonathan Ellis <jb...@gmail.com>.
You're right, it doesn't set nodelay. Alexey's analysis was that "If
TFramedTransport used just one write() call per frame, there is no
need for setNoTcpDelay."

I don't know if he was right or not but it was a deliberate choice and
not an oversight.

On Mon, Feb 7, 2011 at 3:08 PM, Chris Morgan <ch...@gmail.com> wrote:
> Hi Bryan.
>
> Actually haven't heard this before. Just started using thrift a few
> days ago. I'll gladly try that for additional performance.
>
> I'd also like to resolve the issue for future users that may consider
> using thrift with mono and abandon the idea when they get 30 messages
> /sec.
>
> Shouldn't the c# TServerSocket work like the cpp and java ones do in
> terms of disabling nagle?
>
> Chris
>
>
>
> On Mon, Feb 7, 2011 at 4:05 PM, Bryan Duxbury <br...@rapleaf.com> wrote:
>> You're probably tired of hearing this already, but please, please use
>> buffered or framed transport. It will make your servers and clients
>> noticeably faster in a lot of cases.
>>
>> On Mon, Feb 7, 2011 at 12:48 PM, Chris Morgan <ch...@gmail.com> wrote:
>>
>>> Hi Jonathan.
>>>
>>> If it were committed wouldn't it be present in svn trunk? I'm using
>>> svn trunk because I was hoping it had been fixed since the last
>>> release.
>>>
>>> I looked at the commit, c1063966, and I don't see any mention of
>>> disabling nodelay and the changes are modifying
>>> src/Transport/TFramedTransport.cs
>>>
>>> My server code looks like:
>>>
>>>                var ourProcessor = new OurProcessor();
>>>                var processor = new TheProcessor.Processor(ourProcessor);
>>>                TServerTransport serverTransport = new TServerSocket(9090);
>>>                TServer server = new TSimpleServer(processor,
>>> serverTransport);
>>>
>>> So I'm not sure how the changes made to TFramedTransport would be
>>> affecting TServerSocket since they don't seem connected.
>>>
>>> Chris
>>>
>>>
>>> On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>>> > Read the ticket you got the patch from -- it's been committed for the
>>> > next release.
>>> >
>>> > On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com> wrote:
>>> >> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com>
>>> wrote:
>>> >>> I just tested it out and setting NoDelay on the socket brought the
>>> >>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
>>> >>> now.
>>> >>>
>>> >>> What now? It looks like the guy that fixed the issue reported by
>>> >>> Jonathan says the solution is to used a frame transport? It still
>>> >>> looks like this is an issue with whatever the default transport is,
>>> >>> TServerSocket I guess?
>>> >>>
>>> >>> Chris
>>> >>>
>>> >>
>>> >> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
>>> >> what cpp and java do?
>>> >>
>>> >> Chris
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Jonathan Ellis
>>> > Project Chair, Apache Cassandra
>>> > co-founder of DataStax, the source for professional Cassandra support
>>> > http://www.datastax.com
>>> >
>>>
>>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
Hi Bryan.

Actually haven't heard this before. Just started using thrift a few
days ago. I'll gladly try that for additional performance.

I'd also like to resolve the issue for future users that may consider
using thrift with mono and abandon the idea when they get 30 messages
/sec.

Shouldn't the c# TServerSocket work like the cpp and java ones do in
terms of disabling nagle?

Chris



On Mon, Feb 7, 2011 at 4:05 PM, Bryan Duxbury <br...@rapleaf.com> wrote:
> You're probably tired of hearing this already, but please, please use
> buffered or framed transport. It will make your servers and clients
> noticeably faster in a lot of cases.
>
> On Mon, Feb 7, 2011 at 12:48 PM, Chris Morgan <ch...@gmail.com> wrote:
>
>> Hi Jonathan.
>>
>> If it were committed wouldn't it be present in svn trunk? I'm using
>> svn trunk because I was hoping it had been fixed since the last
>> release.
>>
>> I looked at the commit, c1063966, and I don't see any mention of
>> disabling nodelay and the changes are modifying
>> src/Transport/TFramedTransport.cs
>>
>> My server code looks like:
>>
>>                var ourProcessor = new OurProcessor();
>>                var processor = new TheProcessor.Processor(ourProcessor);
>>                TServerTransport serverTransport = new TServerSocket(9090);
>>                TServer server = new TSimpleServer(processor,
>> serverTransport);
>>
>> So I'm not sure how the changes made to TFramedTransport would be
>> affecting TServerSocket since they don't seem connected.
>>
>> Chris
>>
>>
>> On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com> wrote:
>> > Read the ticket you got the patch from -- it's been committed for the
>> > next release.
>> >
>> > On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com> wrote:
>> >> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com>
>> wrote:
>> >>> I just tested it out and setting NoDelay on the socket brought the
>> >>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
>> >>> now.
>> >>>
>> >>> What now? It looks like the guy that fixed the issue reported by
>> >>> Jonathan says the solution is to used a frame transport? It still
>> >>> looks like this is an issue with whatever the default transport is,
>> >>> TServerSocket I guess?
>> >>>
>> >>> Chris
>> >>>
>> >>
>> >> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
>> >> what cpp and java do?
>> >>
>> >> Chris
>> >>
>> >
>> >
>> >
>> > --
>> > Jonathan Ellis
>> > Project Chair, Apache Cassandra
>> > co-founder of DataStax, the source for professional Cassandra support
>> > http://www.datastax.com
>> >
>>
>

Re: slow c# server under mono

Posted by Bryan Duxbury <br...@rapleaf.com>.
You're probably tired of hearing this already, but please, please use
buffered or framed transport. It will make your servers and clients
noticeably faster in a lot of cases.

On Mon, Feb 7, 2011 at 12:48 PM, Chris Morgan <ch...@gmail.com> wrote:

> Hi Jonathan.
>
> If it were committed wouldn't it be present in svn trunk? I'm using
> svn trunk because I was hoping it had been fixed since the last
> release.
>
> I looked at the commit, c1063966, and I don't see any mention of
> disabling nodelay and the changes are modifying
> src/Transport/TFramedTransport.cs
>
> My server code looks like:
>
>                var ourProcessor = new OurProcessor();
>                var processor = new TheProcessor.Processor(ourProcessor);
>                TServerTransport serverTransport = new TServerSocket(9090);
>                TServer server = new TSimpleServer(processor,
> serverTransport);
>
> So I'm not sure how the changes made to TFramedTransport would be
> affecting TServerSocket since they don't seem connected.
>
> Chris
>
>
> On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> > Read the ticket you got the patch from -- it's been committed for the
> > next release.
> >
> > On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com> wrote:
> >> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com>
> wrote:
> >>> I just tested it out and setting NoDelay on the socket brought the
> >>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
> >>> now.
> >>>
> >>> What now? It looks like the guy that fixed the issue reported by
> >>> Jonathan says the solution is to used a frame transport? It still
> >>> looks like this is an issue with whatever the default transport is,
> >>> TServerSocket I guess?
> >>>
> >>> Chris
> >>>
> >>
> >> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
> >> what cpp and java do?
> >>
> >> Chris
> >>
> >
> >
> >
> > --
> > Jonathan Ellis
> > Project Chair, Apache Cassandra
> > co-founder of DataStax, the source for professional Cassandra support
> > http://www.datastax.com
> >
>

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
Hi Jonathan.

If it were committed wouldn't it be present in svn trunk? I'm using
svn trunk because I was hoping it had been fixed since the last
release.

I looked at the commit, c1063966, and I don't see any mention of
disabling nodelay and the changes are modifying
src/Transport/TFramedTransport.cs

My server code looks like:

                var ourProcessor = new OurProcessor();
                var processor = new TheProcessor.Processor(ourProcessor);
                TServerTransport serverTransport = new TServerSocket(9090);
                TServer server = new TSimpleServer(processor, serverTransport);

So I'm not sure how the changes made to TFramedTransport would be
affecting TServerSocket since they don't seem connected.

Chris


On Mon, Feb 7, 2011 at 3:36 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> Read the ticket you got the patch from -- it's been committed for the
> next release.
>
> On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com> wrote:
>> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com> wrote:
>>> I just tested it out and setting NoDelay on the socket brought the
>>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
>>> now.
>>>
>>> What now? It looks like the guy that fixed the issue reported by
>>> Jonathan says the solution is to used a frame transport? It still
>>> looks like this is an issue with whatever the default transport is,
>>> TServerSocket I guess?
>>>
>>> Chris
>>>
>>
>> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
>> what cpp and java do?
>>
>> Chris
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>

Re: slow c# server under mono

Posted by Jonathan Ellis <jb...@gmail.com>.
Read the ticket you got the patch from -- it's been committed for the
next release.

On Mon, Feb 7, 2011 at 2:32 PM, Chris Morgan <ch...@gmail.com> wrote:
> On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com> wrote:
>> I just tested it out and setting NoDelay on the socket brought the
>> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
>> now.
>>
>> What now? It looks like the guy that fixed the issue reported by
>> Jonathan says the solution is to used a frame transport? It still
>> looks like this is an issue with whatever the default transport is,
>> TServerSocket I guess?
>>
>> Chris
>>
>
> In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
> what cpp and java do?
>
> Chris
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
On Mon, Feb 7, 2011 at 3:30 PM, Chris Morgan <ch...@gmail.com> wrote:
> I just tested it out and setting NoDelay on the socket brought the
> rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
> now.
>
> What now? It looks like the guy that fixed the issue reported by
> Jonathan says the solution is to used a frame transport? It still
> looks like this is an issue with whatever the default transport is,
> TServerSocket I guess?
>
> Chris
>

In addition the cpp TSocket.cpp sets TCP_NODELAY. Why shouldn't c# do
what cpp and java do?

Chris

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
I just tested it out and setting NoDelay on the socket brought the
rate up from 30msg/sec up to ~12k msg/sec which is fine for me for
now.

What now? It looks like the guy that fixed the issue reported by
Jonathan says the solution is to used a frame transport? It still
looks like this is an issue with whatever the default transport is,
TServerSocket I guess?

Chris



On Mon, Feb 7, 2011 at 3:16 PM, Diego Jancic <ja...@gmail.com> wrote:
> Did you check the patch suggested by Jonathan? (
> https://issues.apache.org/jira/browse/THRIFT-904)
>
> It says it was resolved on 27/Jan/11
>
>
> On Mon, Feb 7, 2011 at 16:42, Chris Morgan <ch...@gmail.com> wrote:
>
>> I looked at that email thread but I didn't see any patch mentioned
>> there.I also tested using the latest version of thrift from svn and
>> I'm seeing the same results.
>>
>> I'm surprised no one has looked into this yet, guess not many people
>> are interested in thrift server on mono....
>>
>> Chris
>>
>>
>> On Sat, Feb 5, 2011 at 12:19 AM, Diego Jancic <ja...@gmail.com> wrote:
>> > Hi,
>> > I found the same issue a long time ago (1.5 years ago:
>> >
>> http://www.mail-archive.com/thrift-user@incubator.apache.org/msg00628.html
>> )
>> > I have not tested the patch.
>> >
>> > Let me know if the solution works.
>> >
>> > On Fri, Feb 4, 2011 at 22:42, Chris Morgan <ch...@gmail.com> wrote:
>> >
>> >> Hello.
>> >>
>> >> I was running some tests to evaluate using mono to run a c# thrift
>> >> server. I created a simple application that passes blobs to the server
>> >> and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
>> >> here
>> >>
>> >> From testing I see:
>> >>
>> >> cpp client -> c# server (mono 2.6) ~30 messages/sec
>> >> cpp client -> c# server (mono 2.11) ~30 messages/sec
>> >> cpp client -> cpp server ~30k messages/sec
>> >>
>> >> The rates are the same whether or not the blob is 50 bytes or 5000
>> bytes.
>> >>
>> >> For my particular use 30 messages a second is a huge bottleneck. Has
>> >> anyone else seen this kind of behavior? Anyone know how to fix it?
>> >>
>> >> Chris
>> >>
>> >
>>
>

Re: slow c# server under mono

Posted by Diego Jancic <ja...@gmail.com>.
Did you check the patch suggested by Jonathan? (
https://issues.apache.org/jira/browse/THRIFT-904)

It says it was resolved on 27/Jan/11


On Mon, Feb 7, 2011 at 16:42, Chris Morgan <ch...@gmail.com> wrote:

> I looked at that email thread but I didn't see any patch mentioned
> there.I also tested using the latest version of thrift from svn and
> I'm seeing the same results.
>
> I'm surprised no one has looked into this yet, guess not many people
> are interested in thrift server on mono....
>
> Chris
>
>
> On Sat, Feb 5, 2011 at 12:19 AM, Diego Jancic <ja...@gmail.com> wrote:
> > Hi,
> > I found the same issue a long time ago (1.5 years ago:
> >
> http://www.mail-archive.com/thrift-user@incubator.apache.org/msg00628.html
> )
> > I have not tested the patch.
> >
> > Let me know if the solution works.
> >
> > On Fri, Feb 4, 2011 at 22:42, Chris Morgan <ch...@gmail.com> wrote:
> >
> >> Hello.
> >>
> >> I was running some tests to evaluate using mono to run a c# thrift
> >> server. I created a simple application that passes blobs to the server
> >> and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
> >> here
> >>
> >> From testing I see:
> >>
> >> cpp client -> c# server (mono 2.6) ~30 messages/sec
> >> cpp client -> c# server (mono 2.11) ~30 messages/sec
> >> cpp client -> cpp server ~30k messages/sec
> >>
> >> The rates are the same whether or not the blob is 50 bytes or 5000
> bytes.
> >>
> >> For my particular use 30 messages a second is a huge bottleneck. Has
> >> anyone else seen this kind of behavior? Anyone know how to fix it?
> >>
> >> Chris
> >>
> >
>

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
I looked at that email thread but I didn't see any patch mentioned
there.I also tested using the latest version of thrift from svn and
I'm seeing the same results.

I'm surprised no one has looked into this yet, guess not many people
are interested in thrift server on mono....

Chris


On Sat, Feb 5, 2011 at 12:19 AM, Diego Jancic <ja...@gmail.com> wrote:
> Hi,
> I found the same issue a long time ago (1.5 years ago:
> http://www.mail-archive.com/thrift-user@incubator.apache.org/msg00628.html)
> I have not tested the patch.
>
> Let me know if the solution works.
>
> On Fri, Feb 4, 2011 at 22:42, Chris Morgan <ch...@gmail.com> wrote:
>
>> Hello.
>>
>> I was running some tests to evaluate using mono to run a c# thrift
>> server. I created a simple application that passes blobs to the server
>> and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
>> here
>>
>> From testing I see:
>>
>> cpp client -> c# server (mono 2.6) ~30 messages/sec
>> cpp client -> c# server (mono 2.11) ~30 messages/sec
>> cpp client -> cpp server ~30k messages/sec
>>
>> The rates are the same whether or not the blob is 50 bytes or 5000 bytes.
>>
>> For my particular use 30 messages a second is a huge bottleneck. Has
>> anyone else seen this kind of behavior? Anyone know how to fix it?
>>
>> Chris
>>
>

Re: slow c# server under mono

Posted by Diego Jancic <ja...@gmail.com>.
Hi,
I found the same issue a long time ago (1.5 years ago:
http://www.mail-archive.com/thrift-user@incubator.apache.org/msg00628.html)
I have not tested the patch.

Let me know if the solution works.

On Fri, Feb 4, 2011 at 22:42, Chris Morgan <ch...@gmail.com> wrote:

> Hello.
>
> I was running some tests to evaluate using mono to run a c# thrift
> server. I created a simple application that passes blobs to the server
> and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
> here
>
> From testing I see:
>
> cpp client -> c# server (mono 2.6) ~30 messages/sec
> cpp client -> c# server (mono 2.11) ~30 messages/sec
> cpp client -> cpp server ~30k messages/sec
>
> The rates are the same whether or not the blob is 50 bytes or 5000 bytes.
>
> For my particular use 30 messages a second is a huge bottleneck. Has
> anyone else seen this kind of behavior? Anyone know how to fix it?
>
> Chris
>

Re: slow c# server under mono

Posted by Chris Morgan <ch...@gmail.com>.
Hmm. That might be the issue but its tough to tell since I'm not
familiar with nagle etc. I'll try pulling down a development snapshot
to see if that fixes the issue.

Chris


On Fri, Feb 4, 2011 at 9:06 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> probably https://issues.apache.org/jira/browse/THRIFT-904
>
> On Fri, Feb 4, 2011 at 5:42 PM, Chris Morgan <ch...@gmail.com> wrote:
>> Hello.
>>
>> I was running some tests to evaluate using mono to run a c# thrift
>> server. I created a simple application that passes blobs to the server
>> and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
>> here
>>
>> From testing I see:
>>
>> cpp client -> c# server (mono 2.6) ~30 messages/sec
>> cpp client -> c# server (mono 2.11) ~30 messages/sec
>> cpp client -> cpp server ~30k messages/sec
>>
>> The rates are the same whether or not the blob is 50 bytes or 5000 bytes.
>>
>> For my particular use 30 messages a second is a huge bottleneck. Has
>> anyone else seen this kind of behavior? Anyone know how to fix it?
>>
>> Chris
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>

Re: slow c# server under mono

Posted by Jonathan Ellis <jb...@gmail.com>.
probably https://issues.apache.org/jira/browse/THRIFT-904

On Fri, Feb 4, 2011 at 5:42 PM, Chris Morgan <ch...@gmail.com> wrote:
> Hello.
>
> I was running some tests to evaluate using mono to run a c# thrift
> server. I created a simple application that passes blobs to the server
> and gets a result code back. I'm running on Kubuntu Mavrick (10.10)
> here
>
> From testing I see:
>
> cpp client -> c# server (mono 2.6) ~30 messages/sec
> cpp client -> c# server (mono 2.11) ~30 messages/sec
> cpp client -> cpp server ~30k messages/sec
>
> The rates are the same whether or not the blob is 50 bytes or 5000 bytes.
>
> For my particular use 30 messages a second is a huge bottleneck. Has
> anyone else seen this kind of behavior? Anyone know how to fix it?
>
> Chris
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com