Best practices for avoiding NLDAS server timeouts
Posted: Tue Mar 04, 2025 1:11 pm America/New_York
Hi,
I've developed some R code that accesses the hourly NLDAS data rods (ASCII) via url by generating links specifying the time frame and NLDAS cells needed for various data elements. I query these URLs in parallel to speed up the process, as it can be quite lengthy over a large time frame. One thing that I've struggled with in accessing the API is how to best structure my calls to the server to avoid timeouts - I find that at varying geographic scales (tens to hundreds of cells), time chunks of around 1,000 hours work well for the most part, but still time out occasionally. Today, I've encountered an issue I was previously unaware of, the NLDAS server said I had too many connections from my IP address. This was puzzling as my code parallelizes over only 7 cores, as I'm using my home computer and not a larger computing cluster. In general I can get around failed calls to the server with error handling in R, but figured I'd ask users here if there are any best practices to make this process as smooth as possible.
Thanks!
I've developed some R code that accesses the hourly NLDAS data rods (ASCII) via url by generating links specifying the time frame and NLDAS cells needed for various data elements. I query these URLs in parallel to speed up the process, as it can be quite lengthy over a large time frame. One thing that I've struggled with in accessing the API is how to best structure my calls to the server to avoid timeouts - I find that at varying geographic scales (tens to hundreds of cells), time chunks of around 1,000 hours work well for the most part, but still time out occasionally. Today, I've encountered an issue I was previously unaware of, the NLDAS server said I had too many connections from my IP address. This was puzzling as my code parallelizes over only 7 cores, as I'm using my home computer and not a larger computing cluster. In general I can get around failed calls to the server with error handling in R, but figured I'd ask users here if there are any best practices to make this process as smooth as possible.
Thanks!