Sorry for the slow reply. I hope you don't mind me CC'ing the mailing list with
your query.
With regards to figuring out how much data has been sent, the best way to do
that is get the return value of the Send() method when you are sending data.
If you want to see how much data is received on the receiving end you could
patch the Channel class' collect_incoming_data() method to print out the amount
of bytes it receives each time.
Hope this helps!
Cheers,
Chris.
On Sat, Jan 22, 2011 at 06:59:08PM +0000, Dan Horn wrote:
> Hi Chris,
>
> First let me thank you for PodSixNet, it's a nice little library :)
>
> My question involves packet sizes. Following your examples, if I send a list in the way you demonstrate it, a sys.getsizeof(data) reveals the structure to be 140bytes (on both the sending and receiving end). However, when I do a sizeof on the data itself, the byte size varies appropriately based on what I actually sent.
>
> For example, if I send 1000 integers just doing a range(1000) in a list, the sizeof(data['numbers']) is like ~4000 bytes, but the sizeof on the data structure itself still is only 140 bytes. I figure this is due to weak references so the actual encapsulated data is what is sent over the wire, in which case, I'm not sure about actual network bandwidth usage. I'm still new to python though, so maybe it's something else. It seems the data itself would be the overhead plus the data it actually contains, but that doesn't seem to be the case.
>
> My next step is to sniff it out with wireshark or some such, but I was curious if you could shed any light on the size of packets/overhead while using PodSixNet. Overall, sending Python data over the wire is far more costly than say, compiled C++ (for some reason, integers in python measure around 10 to 12 bytes, depending). Is sys.getsizeof() just overly generous, or have you noticed packet sizes being quite hefty on the overhead as well?
>
> Thanks in advance,
> -Dan
-------------------
http://mccormick.cx
Thanks for drawing this to my attention. I will have to do some poking around
and see what is causing this. I suspect it's a memory leak somewhere, something
not being cleaned up correctly in between packets, but I will have a look.
Cheers,
Chris.
> On Jan 24, 11:19ï¿œpm, "ch...@mccormick.cx" <ch...@mccormick.cx> wrote:
> > Hi Dan,
> >
> > Sorry for the slow reply. I hope you don't mind me CC'ing the mailing list with
> > your query.
> >
> > With regards to figuring out how much data has been sent, the best way to do
> > that is get the return value of the Send() method when you are sending data.
> >
> > If you want to see how much data is received on the receiving end you could
> > patch the Channel class' collect_incoming_data() method to print out the amount
> > of bytes it receives each time.
> >
> > Hope this helps!
> >
> > Cheers,
> >
> > Chris.
> >
> > On Sat, Jan 22, 2011 at 06:59:08PM +0000, Dan Horn wrote:
> > > Hi Chris,
> >
> > > First let me thank you for PodSixNet, it's a nice little library :)
> >
> > > My question involves packet sizes. ï¿œFollowing your examples, if I send a list in the way you demonstrate it, a sys.getsizeof(data) reveals the structure to be 140bytes (on both the sending and receiving end). ï¿œHowever, when I do a sizeof on the data itself, the byte size varies appropriately based on what I actually sent.
> >
> > > For example, if I send 1000 integers just doing a range(1000) in a list, the sizeof(data['numbers']) is like ~4000 bytes, but the sizeof on the data structure itself still is only 140 bytes. ï¿œI figure this is due to weak references so the actual encapsulated data is what is sent over the wire, in which case, I'm not sure about actual network bandwidth usage. ï¿œI'm still new to python though, so maybe it's something else. ï¿œIt seems the data itself would be the overhead plus the data it actually contains, but that doesn't seem to be the case.
> >
> > > My next step is to sniff it out with wireshark or some such, but I was curious if you could shed any light on the size of packets/overhead while using PodSixNet. ï¿œOverall, sending Python data over the wire is far more costly than say, compiled C++ (for some reason, integers in python measure around 10 to 12 bytes, depending). ï¿œIs sys.getsizeof() just overly generous, or have you noticed packet sizes being quite hefty on the overhead as well?
> >
> > > Thanks in advance,
> > > -Dan
> >
> > -------------------http://mccormick.cx
>
> --
> You received this message because you are subscribed to the Google Groups "PodSixNet" group.
> To post to this group, send email to pods...@googlegroups.com.
> To unsubscribe from this group, send email to podsixnet+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/podsixnet?hl=en.
>
-------------------
http://mccormick.cx
Is there any chance you could send me the code you are using to test this so I
can reproduce it and fix it?
Cheers,
Chris.
On Thu, Jan 27, 2011 at 11:41:34AM -0800, catch22 wrote:
> On Jan 24, 11:19ï¿œpm, "ch...@mccormick.cx" <ch...@mccormick.cx> wrote:
> > Hi Dan,
> >
> > Sorry for the slow reply. I hope you don't mind me CC'ing the mailing list with
> > your query.
> >
> > With regards to figuring out how much data has been sent, the best way to do
> > that is get the return value of the Send() method when you are sending data.
> >
> > If you want to see how much data is received on the receiving end you could
> > patch the Channel class' collect_incoming_data() method to print out the amount
> > of bytes it receives each time.
> >
> > Hope this helps!
> >
> > Cheers,
> >
> > Chris.
> >
> > On Sat, Jan 22, 2011 at 06:59:08PM +0000, Dan Horn wrote:
> > > Hi Chris,
> >
> > > First let me thank you for PodSixNet, it's a nice little library :)
> >
> > > My question involves packet sizes. ï¿œFollowing your examples, if I send a list in the way you demonstrate it, a sys.getsizeof(data) reveals the structure to be 140bytes (on both the sending and receiving end). ï¿œHowever, when I do a sizeof on the data itself, the byte size varies appropriately based on what I actually sent.
> >
> > > For example, if I send 1000 integers just doing a range(1000) in a list, the sizeof(data['numbers']) is like ~4000 bytes, but the sizeof on the data structure itself still is only 140 bytes. ï¿œI figure this is due to weak references so the actual encapsulated data is what is sent over the wire, in which case, I'm not sure about actual network bandwidth usage. ï¿œI'm still new to python though, so maybe it's something else. ï¿œIt seems the data itself would be the overhead plus the data it actually contains, but that doesn't seem to be the case.
> >
> > > My next step is to sniff it out with wireshark or some such, but I was curious if you could shed any light on the size of packets/overhead while using PodSixNet. ï¿œOverall, sending Python data over the wire is far more costly than say, compiled C++ (for some reason, integers in python measure around 10 to 12 bytes, depending). ï¿œIs sys.getsizeof() just overly generous, or have you noticed packet sizes being quite hefty on the overhead as well?
> >
> > > Thanks in advance,
> > > -Dan
> >
> > -------------------http://mccormick.cx
>