Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by programmingjay · Jun 03, 2011 at 11:20 AM · servercpubatchmode

batchmode consumes 100% cpu

Hi,

I've built a dedicated unity server for my game that essentially just passes messages around to other clients and not much else. I know from reading around that using a unity build for this is a bit overkill but that's what was decided.

My problem is that when running the application with batchmode it consumes 100% of the cpu but when I run it without batchmode it barely uses any.

I've limited the framerate of the server using Application.targetFrameRate to keep it locked at 60 fps and there are no graphical objects/cameras for the server, and no exceptions or other errors are showing up in my logs.

Does anyone know what could possibly be going on?

Thanks

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image killroy · Dec 19, 2012 at 06:37 PM 0
Share

I have the same problem. Empty scene, Application.targetFrameRate = 60, and when I start in batchmode on a virtual private server, CPU goes to 100%

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by killroy · Dec 19, 2012 at 11:00 PM

I had the same problem and it seems it was associated to several unrelated problems.

  1. I was running an app that was built from a project that was created with an older 3.5 version of Unity and then upgraded several times as new Unity version were released. The solution for me was to use text format for metadata files (Edit->Project Settings->Editor->Asset Serialization->Force Text). Then I created a clean project and compared the files in Project Settings. Some of the options were missing in the old version or they didn't contain all the data. For example: m_PerPlatformDefaultQuality in QualitySettings.asset didn't contain a few platform definitions.

  2. Another problem was that one of my prefabs contained either an animation that had leftover curves which can be removed in Animation Editor or it was related to the material of that prefab which was a Substance material.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by martyman0909 · Jan 04, 2013 at 10:33 PM

Which platform are you running on?

Also, targetFrameRate has no effect if you're vsync is set to on (in quality settings). Change it to 0 and see if that helps.

Also try adding a manual framerate limiter that sleeps a thread, i.e.

   private float goalFPS = 30;
   private float millisecondsToWait = 0; 
 
   public void Update()
   {
     var overflow = 1.0/goalFPS - Time.deltaTime;
 
     if (overflow > 0.0)
         millisecondsToWait++;
     else
         millisecondsToWait--;
     
     Thread.Sleep( (int)Mathf.Clamp(millisecondsToWait, 0.0f, 1.0f/goalFPS * 1000.0f) ); // clamp for sanity
   }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

running servers for networked games 0 Answers

Batchmode console server 0 Answers

Linux game server 1 Answer

How to tell if the game is running in batchmode? 2 Answers

Console Application 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges