Autor Beitrag
chukalv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 44



BeitragVerfasst: Sa 27.05.06 14:56 
The idea:

Every 20 seconds my delphi project checks for a speciffic page with the IDHTTP.POST. The page (a normal php file) returns only one word "yes" or "no". The post data consists of about 30 characters...

So how could this affect the internet traffic for the user?

My "calculations". Each 20 seconds the program posts about 3kb* and receives 2kb** that`s 5 kb overall. That`s 5*3=15 kb in a minute, 900 kb in an hour, 21 megabytes in a day. That`s too much!!!

Is this so or is this not so? If yes then how to bypass this problem?


* Don`t know how much could 30 charcters of posting. Could that be that that`s 3 kb?
** The same as *
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 27.05.06 15:08 
I think it's 143kb/day :rofl:

33Chars = 33Bytes = 33/1000 KB, right?

33 * 3 (per minute) * 60 (per hour) * 24 (per day) / 1000 (in KB) = 143KB :?


greetz


EDIT: Why should 30Bytes be 3kb and 2/3 Bytes be 2kb? doesnt make sense...

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Handycommander
ontopic starontopic starofftopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1054

Windows XP Pro, Vista
Visual Studio 2008
BeitragVerfasst: Sa 27.05.06 15:49 
i think it's 216 kb a day!

(30 + 20) * 3 * 60 * 24 / 1000

best wishes
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 27.05.06 15:59 
nope, its not 30+20, because the return is "yes" or "no" (3 or 2 bytes ;) )

greetz

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 27.05.06 16:06 
I think you have to keep in mind that it causes a lot more traffic because there is also the TCP and IP overhead which counts here.

AXMD
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Sa 27.05.06 16:09 
Just wanted to add, that you've to be careful: kb = kilobit; kB = kiloByte
Furthermore you have to think about the HTTP protocol! It's not only those 30 Bytes to and 3 Bytes from the server but also the HTTP instructions.


MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 27.05.06 17:17 
If you to the minimal stuff required for a HTTP POST request you get:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
POST /file.php HTTP/1.1
Host: hostname
Content-Length: 30
Content-Disposition: Attachment

YourDataYourDataYourDataYourDa


on upstream

and

ausblenden Quelltext
1:
2:
3:
4:
200 Ok
Content-Length: 3

Yes


on downstream (on best case) (in Normal both require much more data).

Thus you get about 130 Bytes up and 29 Bytess down (not including the about 200 Bytes TCP\IP overhead).

Using that information I get about 1,5 MB traffic per day. (359 Bytes per Request)

Optimizations:
- Use a GET-Request instead of POST (shorter Requests)
- Generate the HTTP-GET-Requests your own (using a socket)
- See if you can save some more bytes ...

What you can't is get below the TCP overhead of about 200 Bytes per Request.

Why don't you write your own server application that handles this in shorter form? Then you had 231 instead of 359 Bytes per Request (about 1MB\day).

You can't get much below that ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
chukalv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 44



BeitragVerfasst: Sa 27.05.06 17:35 
Thanks BenBe, the INFO is really usefull to me!

IMHO 1.5 MB a day is not soo much...

The server side program is not possible in this case because of some other reasons. Anyway in a server program case I would spare only about 0.5 MB.

Thanks!