outside of the ddos attacks you're having this issue? if you're on wifi it could be signal dropping or packet loss. your router could be going bad. my router sucks even 10m away cause it's really old.
try plugging in direct via ethernet and see if the issue persists. if you already use wired connection, try closing all apps other than APB (torrent apps, game launchers, etc), and run a virus scan using Malwarebytes or smth (also check if windows update is doing anything funky)
possibly could be a driver issue with your wifi card/ethernet port, but i doubt it. still maybe try reinstalling your drivers
if you still have an issue with lags after taking these steps, call your ISP up, cable lines might be messed or something. if they say the lines are working as intended, then you're being throttled by your ISP, or it's the server's fault