(probably noob question) High ping on self-hosted server

I'm running my Minecraft server on my own PC and even with performance mods, the server is laggy from my own Minecraft client. Inputting commands into the server is perfectly fine, but doing so from my own client takes 5 seconds or even more to work. Placing and destroying blocks is also laggy, as well as the sounds. Sometimes when I try to break a block, the block briefly reappears and plays the breaking animation.

I think it's something to do with the server view distance because I increased it from 8 to 16 and the ping clearly increased. (It was already not good on 8...)
So how would I decrease this lag as much as possible while keeping as much view distance as I want?
Was this page helpful?