Jump to content

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
Sign in to follow this  
=ADK= warspite

Ringing lag spike, thy name is Punkbuster!

Recommended Posts

As most of you know, I've been on a quest lately to reduce as much as possible the lag that many of us experience while playing Battlefield 3 multiplayer.  This post is one example.  The good thing about this relentless pursuit of lag reduction is that many of its underlying principles can be applied to virtually any game, so the gamer's experience benefits as a whole.

 

As a quick review, here are some of the things you can do to reduce all kinds of lag/stutter and enjoy a better overall online gaming experience.  Some I'm still working on, some I don't have the required hardware to do.  This isn't a complete list, but the more of these things you can do, the better off you will be.

 

- Ensure you have a solid network hardware installation

- Latest firmware on your router

- Disable uPNP on both your router and in Windows

- All PC drivers (including chipset drivers from your mobo vendor) are current

- Limit your games' FPS to one or two FPS below your monitor's refresh rate (anything else is a waste)

    - Prevents wide swings in FPS and the stuttering that can cause

    - Helps your CPU and GPU run cooler

    - Reduces/eliminates screen tearing (that always happens when FPS exceeds monitor refresh rate)

- Have your keyboard and mouse on one USB controller, and have all other devices on a separate USB controller

- Have your OS and games installed on separate physical HDDs and have those drives on separate HDD controllers

- Disable useless Windows services (Black Viper has a great website, google him)

- Stuff that causes crazy stuttering on my rig:

    - Intel Speed Step (crying in my beer over this one)

    - All of the "C" reports in UEFI related to CPU throttling (C1E, C7, etc.)

 

There are many more, but that list should give you some things to consider.

 

Now, on to teh main topic of this post.

 

In my earlier post (linked above), I said that Punkbuster (PB) was not to blame.  Well, that is only partially true.  At the time, I was chasing another sort of lag and while PB had nothing to do with that particular flavor of lag, testing did indeed reveal that PB can cause a significant amount of lag under the right conditions (i.e. on my rig  :( ).

 

How did I learn about this, you ask?  Well, I did a lot of research and experimenting and I was lucky enough to blunder onto a tool called Latency Monitor.  There are others out there, but this one worked well for me.  Using Latencymon, it was pretty obvious that pnkbstrb.exe was creating a significant  amount of writing to disk (hard page faults).

 

Some background is in order here.  This topic focuses mainly on lag (latency) that originates inside your PC.  Lag has two major root causes: 1) bad drivers or hardware (causes Deferred Procedure Call latency), and 2) processes that cause hard page faults (they can degrade system performance by causing excessive writing to disk).

 

The one process on my rig that causes hard page faults (other than essential Windows process that I can do nothing about) is pnkbstrb.exe.  Since PB is essential to most online gaming, I simply can't get rid of it and documentation is very sparse on how to deal with it.  Well, the first thing one should do if PB is suspected of causing a problem is to make sure PB is updated via Evenbalance's website... which I did.  Next, I played about 30 minutes on a non-PB server and did not see the ringing lag spike even once while in game.  I also disabled both PB services in game (on a server that uses PB) after observing the spikes, and did not see the spikes reoccur before being kicked by PB.  Given these things, I felt pretty confident that I had isolated the ringing lag spike... my own personal White Whale.  What does a ringing lag spike look like?  Well, here that bastard is... in all its naked glory.

 

Wave_zps6251bc4f.jpg

 

This waveform is very distinctive and is separated from normal (Internet) lag spikes by the trailing "ring" that always follows it.  A normal lag spike lacks the distinctive sawtooth ringing.  This particular lag spike is caused by pkbstrb.exe (on my system, anyway).

 

Ok, now that I've isolated the ring, what can I do about it?  Well, not much except pat myself on the back for a job well-done.  Since uninstalling PB isn't an option, and documentation for tweaking PB is damn-near nonexistent, one's options are pretty limited.  Fortunately, that doesn't mean that there is NOTHING that can be done.  In fact, I feel that what little I've been able to do has made a significant impact on this lag spike, and now I'm going to share what I know with you.

 

Digging into the PB manual and doing some research online has revealed some interesting information.  PB does extensive scans of a PC's memory in order to root out hackers.  By default, the PB client on your PC performs this scan every 20ms (.02 sec) and it captures screenshots which it writes to disk as well as transmits back to its server.  On my system, this means that 1 of every four frames is scanned for hacks.  On my screen, I see this particular lag spike every 3-5 seconds... sometimes it's just a single, sometimes it comes in trains of 2-3 spikes, then a 3-5 second gap, then the cycle repeats itself.  These lag spikes don't make the game unplayable by any stretch, it's just that the brief stuttering they cause is damned annoying.  

 

That scan every 20ms is no small amount of overhead, my friends and fortunately there are changes you can make to PB's config file (pbsys.cfg) that can help reduce the impact of this lag somewhat.  

 

The tweaks for BF3:

- Create a text file called pbsys.cfg in this folder:  C:\Users\UserName\AppData\Local\PunkBuster\BF3\pb\   (don't forget to change the file's extension from .txt to .cfg just as you would for BF3's user.cfg file.

- Feel free to use the text of my pb.cfg file.   After I made the changes and rebooted, I played for over an hour on an ADK PB-enabled server without a problem.

 

pb_MsgPrefix "PunkBuster Client" //[PB Message Prefix] 

pb_Sleep 500 //[# of Milliseconds (default=20)] 
pb_LogToFile 0 //[0=No, 1=Yes (default=0)] 
pb_SsLog 0 //[0=No, 1=Yes (default=1)] 
pb_SsSave 0 //[0=No, 1=Yes (default=0)] 
pb_SsOptions 640 480 50 50 1 //[- Set local PB screenshot options, default = native screen resolution]
 
* Explanations of these variables and what they do can be found here.

 

On my system, the net effect of adding the pbsys.cfg file and installing the variables shown was to decrease the frequency of the ringing lag spikes from every 3-5 seconds to about every 30-40 seconds.  Not the ideal solution, but I will take it over getting hammered every 3-5 seconds.

 

Well, that's about it for this chapter.  If anyone has cracked this particular nut better than I have, please PM me or reply to this thread.  I wanna learn at your feet, Mr. Hero.

 

Until next time,

 

war

Edited by =ADK= warspite

Share this post


Link to post
Share on other sites

You need to start a post that needs to be pinned that has all of these articles in them in one place

Hahaha, it has become quite the epic saga and I suppose that, over time, it will become lost unless it is pinned.  I'm doing my best to use tags so that they can be easily Googled or searched in our forums.  I will PM the Mod and see how he would like to move forward.

 

Thanks!

 

war

Share this post


Link to post
Share on other sites

another great post war

 

will some of these things work for other games too?

 

They should.  Many are general in nature and will reduce latency across your entire system, so EVERY application you run will benefit.  Example, captuing (Dxtory) and encoding video (for youTubing) would benefit greatly by having your OS, game, and Dxtory on one drive under one controller and having your captured video on another drive under a 2nd controller.  Fortunately, most gaming mobos come with two SATA controllers.  Mine has separate Intel and a Marvell SATA controllers.  Lots of great info on how to set up a youTubing rig in Google.  Sadly, most do not take advantage of these great features.

Share this post


Link to post
Share on other sites

Very very nice post there war.  I'll have to try to play around with some of the PB options you mentioned.  Even at the beginning of your post I didn't even think of how even the controllers can even out performance.  Even if its just minute.

It is interesting how so many people are fixated on FPS, as if that's the only benchmark that matters.  I would ask, "What good is high FPS if your rig is dragged down by hardware configurations and faults, drivers, and software that cause excessive latency?  Forums are filled with guys crying about how their rigs are crippled by massive stuttering as they churn out 150+ FPS.  It is so much better, for example if you have a 60Hz monitor, to crank out a buttery smooth 59FPS and have a great picture than to have a monster rig that can dish out 200FPS, but because of the issues noted above, is plagued with stuttering and screen tearing.

 

This is the same issue that people talk about with CPUs in smart phones... they are already fast enough, now people want configurations and software optimized for a smooth experience... so it is with PC gaming.  Managing latency at modest FPS has been one of the key successes that drive the console gaming experience.

Share this post


Link to post
Share on other sites
War hit the mark again. I use the term performance and all around configuration not just FPS or ping. Literally hundreds of things effect your system as a whole.

I currently am turning to War for direction and opinion because of his fact and tried methods to squeak out performance to be ready for BF4 (but I made a noob mistake).

Once again an awesome post with outstanding information.

Share this post


Link to post
Share on other sites

It is interesting how so many people are fixated on FPS, as if that's the only benchmark that matters.  I would ask, "What good is high FPS if your rig is dragged down by hardware configurations and faults, drivers, and software that cause excessive latency?  Forums are filled with guys crying about how their rigs are crippled by massive stuttering as they churn out 150+ FPS.  It is so much better, for example if you have a 60Hz monitor, to crank out a buttery smooth 59FPS and have a great picture than to have a monster rig that can dish out 200FPS, but because of the issues noted above, is plagued with stuttering and screen tearing.

 

This is the same issue that people talk about with CPUs in smart phones... they are already fast enough, now people want configurations and software optimized for a smooth experience... so it is with PC gaming.  Managing latency at modest FPS has been one of the key successes that drive the console gaming experience.

I never thought of that.

 

War hit the mark again. I use the term performance and all around configuration not just FPS or ping. Literally hundreds of things effect your system as a whole.

I currently am turning to War for direction and opinion because of his fact and tried methods to squeak out performance to be ready for BF4 (but I made a noob mistake).

Once again an awesome post with outstanding information.

Me too! I agree.

Share this post


Link to post
Share on other sites

They should.  Many are general in nature and will reduce latency across your entire system, so EVERY application you run will benefit.  Example, captuing (Dxtory) and encoding video (for youTubing) would benefit greatly by having your OS, game, and Dxtory on one drive under one controller and having your captured video on another drive under a 2nd controller.  Fortunately, most gaming mobos come with two SATA controllers.  Mine has separate Intel and a Marvell SATA controllers.  Lots of great info on how to set up a youTubing rig in Google.  Sadly, most do not take advantage of these great features.

i play more mmos and am running xfire 5770 and having some frame spikes.  want to level it out if i can so ill try some of these out

 

thanks man :)

Share this post


Link to post
Share on other sites

In your BF3 cfg file. Default is 200 FPS

Lots of info on how to set up a user.cfg file out there.  The key is limiting your FPS 1-3 FPS below your monitor's refresh rate.  If 60Hz, try limiting to 59 & test, then 58 and so on.  For me, with my 120Hz monitor, 117FPS was the sweet spot.  I get vsync-like smoothness in game with ZERO input lag and NO screen tearing.  Just make sure that your rig can generate a steady 59-ish FPS and all should be well.

Edited by =ADK= warspite

Share this post


Link to post
Share on other sites

Hahaha, it has become quite the epic saga and I suppose that, over time, it will become lost unless it is pinned.  I'm doing my best to use tags so that they can be easily Googled or searched in our forums.  I will PM the Mod and see how he would like to move forward.

 

Thanks!

 

war

Looks like AOB has listened and set me up with my own little corner of cyberspace.   :)   Thanks AOB!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

This website uses cookies to provide the best experience possible. Privacy Policy & Terms of Use