You didn't tell what kind of server you are running ( dedicated/VPS/shared) but 500K items is fairly big. It should run fine using the command line however it might ( and in your case will) get critical. Small changes might tip the iceberg.
MySQL server has gone away
is usually an error whenever the php script takes to long to process. For example downloading the feed is a bit slower. (The dataase connection is initiated before download starts)
You can try to add
into your feeds.php
these will force the parser to download the feed first then run the import on the local file. This might not solve you prolem on the first run, but on a second the parser will use the cached local file.