problems getting large numbers of sub categories and images from smugmug using smugPH
Lint
Registered Users Posts: 27 Big grins
first off, I'm not sure if this is a Smugmug problem, a phpsmug problem or my problem, but I'm kind of stuck so I'll post anyway and see what pops its head over the parapet.
It started off when I was pulling information about my entire Smugmug data set out for a Wordpress plugin. I was doing it in a pretty brain dead kind of way, grabbing the categories then for each category, grabbing the sub categories then for each sub category grabbing its albums .... etc. The first once or twice that I ran the page it was fine and then I started to get blank pages, which I took to be PHP timeouts at my provider's end - they set PHP timeout to 10 seconds. After a bit I found that if I limited the count of sub-categories from 60 and odd to around 20, the problem didn't entirely go away but it behaved a whole lot better. So it seems the problem might have something to do with loads of calls into the API.
I'm grabbing a new phpSmug object and handing it a token at the start of the page. I'm not storing anything in the session - other than the oauth token, obviously - and I wonder if this might be the wrong thing to do.
Any help appreciated.
Oauth newbie, by the way.
It started off when I was pulling information about my entire Smugmug data set out for a Wordpress plugin. I was doing it in a pretty brain dead kind of way, grabbing the categories then for each category, grabbing the sub categories then for each sub category grabbing its albums .... etc. The first once or twice that I ran the page it was fine and then I started to get blank pages, which I took to be PHP timeouts at my provider's end - they set PHP timeout to 10 seconds. After a bit I found that if I limited the count of sub-categories from 60 and odd to around 20, the problem didn't entirely go away but it behaved a whole lot better. So it seems the problem might have something to do with loads of calls into the API.
I'm grabbing a new phpSmug object and handing it a token at the start of the page. I'm not storing anything in the session - other than the oauth token, obviously - and I wonder if this might be the wrong thing to do.
Any help appreciated.
Oauth newbie, by the way.
0
Comments
Want faster uploading? Vote for FTP!
Is there any chance you could email me your code to take a look at ? david at smugmug
Cheers,
David
SmugMug API Developer
My Photos
The API server can handle thousands of requests a second, but it chokes when the same session tries several requests per second. The solution may be to have a different session ID for each piece of information.
Now, I know this sounds kinda crazy, but you'd basically login each time and get a new session ID with each request. This way, the server won't reject it. (I'm assuming that it won't look at this as some sort of attack and lock you out.)
Thoughts?
Want faster uploading? Vote for FTP!
He's using OAuth so he doesn't need to do this.
SmugMug API Developer
My Photos
Want faster uploading? Vote for FTP!