Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent server/client from sending/requesting same file twice. #1345

Open
R4to0 opened this issue Sep 7, 2013 · 3 comments
Open

Prevent server/client from sending/requesting same file twice. #1345

R4to0 opened this issue Sep 7, 2013 · 3 comments
Assignees
Labels

Comments

@R4to0
Copy link

R4to0 commented Sep 7, 2013

Hello! I don't know if this is considered a feature request or a bug, but here we go! This affects all GoldSrc Engine mods and games. No metamod/amxx have been used while testing this. My english is limited, you may see typos.


Intro:

When we start a map, the server/client precaches all needed files to send to client reading from resource file (mapname.res), and if we don't have the res file, server precache itself some files and tries to send to client: models, sprites and sounds (not all of them, miss *t.mdl *01.mdl and some spr, making client crashes, needs to be mentioned in a res file).


The problem:

With resource file correctly generated (using resgen or by hand) and all file dependencies mentioned in it, the server keeps sending some files twice or more, making the client request a file that has been downloaded in same session, wasting bandwidth and slowing download!


Test environment:

Server side (home made):
Window Server 2003 x86 up to date;
2GB DDR2 667MHz;
30mbit download speed, 7mbit upload speed;
HLDS for Half-Life DM build 6132
IP: 187.22.113.208:27019
Password: testing

Client side:
Windows 8 Pro 64-bit up to date;
4GB DDR2 800MHz;
10mbit download speed;
Half-Life build 6153


Reproducing:

I'll use a map called persia for this.

Map structure:
http://pastebin.com/fyTCbf47

We have 48 files excluding .res file!

Let's try without .res file first and see which files server tries to send to client:
http://pastebin.com/73PtWEu8

9 of 48 files have been sent by hlds to client.

Let's try with .res file in maps folder:
http://pastebin.com/7MSjYpsn

Now we have requested 58 files from server! But we only have 48 files for this map!


Conclusion and benefits:

  • Make server check if file has been precached before trying do again;
  • This will help avoid server hitting "512 precache limit" in mods with huge resource usage like Sven Co-op;
  • Less memory usage (i think);
  • Less bandwidth usage;
  • Less requests made to server/webserer;
  • Reduces download time.

I think that is all. I hope anyone can understand...

Thanks,
Rafael "R4to0" Maciel.

@ghost ghost assigned alfred-valve Sep 9, 2013
@alfred-valve
Copy link
Contributor

Can you post the map and its resources as a download link here please so we can test this locally.

@R4to0
Copy link
Author

R4to0 commented Sep 10, 2013

2 good maps for testing:
http://fastdl.hldm-br.net/persia.zip
http://fastdl.hldm-br.net/ag_crossfirexM.zip

I can't provide a test server atm, router hardware failure (solving asap).

@di57inct
Copy link

I can confirm this issue. Happened to me lots of times. Same file downloaded twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants