dreamfactorysoftware / df-core

The DreamFactory Core services and resources.
Apache License 2.0
14 stars 32 forks source link

1040 Too many connections error while fetching related data #6

Open DawoonC opened 8 years ago

DawoonC commented 8 years ago

Hi,

I'm trying to fetch related data from my DB as described in here, http://blog.dreamfactory.com/sql-and-rest-working-with-related-data. So far, I was able to fetch related data from multiple tables with small set of data by limiting number of results (LIMIT). However, when I removed LIMIT statement and try to fetch related data, the DSP service responded with 1040 too many connections error. My DB is hosted on Amazon RDS service with mySQL and it has max connection limit of 60. The table I'm trying to fetch has 62 rows, and it has foreign keys belong to other tables which have 430 rows and 43 rows. Despite there are so few rows in all three tables, getting too many connection error seems really strange to me. Could you explain how DSP is making related data joined under the hood, and maybe a possible solution to solve this issue?

Thank you

DawoonC commented 8 years ago

I tried again with Amazon's Aurora DB with the same data, which I assume does not have connection limit, there was no connection error, but it was really slow. It took me 2.4 seconds to retrieve 62 rows with two related data. And when I doubled the rows (124 rows), it took me doubled time (4.7 secs).

I also tested this with DSP 1.9.x version, and it took me 1 second to retrieve 124 rows with two related data (I forgot to mention that the original test was held on DSP 2.1 version).

It seems 1.9.x version shows much better performance than latest 2.1 version.

drewpearce commented 8 years ago

Have you seen increased performance in the more recent releases? We've seen some great test results in 2.2.