My minecraft client lags while hosting server

so i run a custom modded server for me and my friends. i notice with 60 mods, my client starts to lag with server running. my system specs: amd-fx 6300 3.5ghz asus gtx 660 dcu oc edition 8gb 1866 ram asus sabertooth 990fx wd black 1 tb 7200 rpm. newest java 64 bit

is there any way that i can increase gaming performance or decrease the server cpu usage to increase fps. i set my client to high priority stuttering is nearly gone and stuttering is now minimal. is there a mod, a plgin that i can use to stop my issue?


Solution 1:

If ONLY the client is lagging: That is a CPU problem, as the server would lag as well if it was a RAM issue, and that would need to be taken care of via upgrading the CPU in your computer, or hitting Ctrl + Alt + Del and selecting Task Manager, finding javaw.exe (That's what it uses on my machine, it might be just Java.exe) and setting the priority to whatever you desire. If that doesn't work you may have to upgrade.

If both the client AND the server are lagging, then that would be a RAM issue and can be fixed by the solution regarding RAM.

Solution 2:

This is a dead post, but I thought this would be beneficial for anyone having issues similar to mine. If you are hosting a server on the same pc you are playing on or your local network and are having lag issues despite your server having enough resources such as memory, RAM, and sufficient internet speeds then this may apply to you.

One simple solution I have found maybe that you are connecting through your network's external IP instead of simply connecting through LAN. This means you are attempting to connect to your server using the IP you would usually give people outside of your local network to connect. This places a much greater load on your router and gives you some bad latency because what you are doing is sending data out your local network, to your ISP, and then straight back to your local network. By comparison, connecting locally would only require data to be sent to the router and then to the respective server host or, in the case the server is on the same computer as the client, data may not even leave the computer.

If you're running your server locally, such as on the same pc as your client, you simply have to type "localhost" as the server IP and you will connect to the server through your device. This will significantly reduce data usage and latency as it is the same as what one would be doing when they play Minecraft natively.

Alternatively, if you are running a server on a different computer on the same network, you can connect using the computer's local IP or IPv4 address and the port the server is open on. For example, you may put "192.168.0.0:25565" as the server IP. The numbers before the colon being the IPv4 address and the numbers after being the server port. Note that you must put in the IPv4 address of the computer running the server, which can be found in a few ways, such as through your router, or typing "ipconfig" into CMD and scrolling to the IPv4 address.

This should significantly cut down on latency as opposed to connecting to your public ip. Finally, it's also important to know that some routers will block attempts to connect to your own public IP from inside the network. If you're having issues connecting to your server, but other people outside your network can, this may be the issue.