View previous topic :: View next topic |
Author |
Message |
nazoa
Joined: 09 Feb 2007 Posts: 56
|
Webserver - file upload speed |
Posted: Thu Apr 17, 2008 11:36 am |
|
|
I have a project using the PIC18F97J60 running at 41.6M. To try things out I am using the webserver2 example provided with the ethernet kit. It works fine but the speed is really quite slow, specially uploading image files. A simple 3K gif file takes about 3 seconds.
Apart from reducing the file size, has anyone got any tips / suggestions for improving the speed? I am storing the files in program memory using the MPFS provided with the ethernet kit.
Thanks |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Thu Apr 17, 2008 11:43 am |
|
|
Write speed is slow for program memory. An SD card would provide much faster write storage speed and somewhat slower read speed. |
|
|
nazoa
Joined: 09 Feb 2007 Posts: 56
|
|
Posted: Thu Apr 17, 2008 12:52 pm |
|
|
I think my problem is the other way around. Reading data from program memory for uploading to the client is very slow. |
|
|
Dimmu
Joined: 01 Jul 2007 Posts: 37
|
|
Posted: Thu Apr 17, 2008 12:56 pm |
|
|
Hi,
I made some tests on download ( from PIC to PC ) with the TCP-IP stack few weeks ago and the download rate was never better than ~4 k/s. I placed some trigger points in the PIC and discovered that the faulty element was not the PIC but the computer + hub.
Since the stack sends only one message then waits for the ACK, the download rate was limited to 1 kb/message exchange with the PC and it was not possible to get better results than 1 message / 250 ms.
The solution is to modify the stack to send more than one message at the time and then monitor the incoming ACK for message lost ( what I plan to do later but I don't know when )
Dimmu |
|
|
nazoa
Joined: 09 Feb 2007 Posts: 56
|
|
Posted: Sat Apr 19, 2008 7:06 am |
|
|
You are right Dimmu. I had a look at the traffic using the Wireshark programme and the PIC always waits for an acknowledge before sending another packet. In some cases it takes 1 or 2 seconds for the acknowledgement to come.
Well, I would be very interested to hear of anyone who has modified the stack to send multiple messages.
Thanks. |
|
|
Dimmu
Joined: 01 Jul 2007 Posts: 37
|
|
Posted: Sun Apr 20, 2008 3:50 am |
|
|
I think that it is possible to configure the stack to send all messages without waiting for the ACK. In this case the communication must be faster but you lose all security on communication.
Make a search for the next : "TCP_NO_WAIT_FOR_ACK"
Dimmu |
|
|
nazoa
Joined: 09 Feb 2007 Posts: 56
|
|
Posted: Mon Apr 21, 2008 11:24 am |
|
|
Good suggestion but unfortunately it does not work too well. What happens is that a lot of packets with check sum errors are generated and the downloading takes just as long. I think there may be an bug somewhere in the stack code. |
|
|
|