plotly / falcon

Free, open-source SQL client for Windows and Mac 🦅
https://plot.ly/free-sql-client-download/
MIT License
5.13k stars 278 forks source link

Memory leak if user not logged to Plotly #257

Closed miahnelson closed 6 years ago

miahnelson commented 6 years ago

When using the query editor in Windows 10 against SQL server 2008 and 2012, the query editor becomes extremely slow. At times taking up to ten seconds to update after typing a single character.

n-riesco commented 6 years ago

To help me debug this issue, I'd need a way reproduce this issue. Could you find a sample text that makes the query editor laggy?

miahnelson commented 6 years ago

Any and all text makes it lag. Just typing SELECT makes it lag. As an example. I just opened Falcon and Typed SELECT and it took several seconds before anything text appeared in the editor.

As an example of a query I ran. SELECT Activitycode, depthin, depthout, cumhours, WOB FROM DDBActivityCorrected Where WOB < 100 AND (Activitycode = 'ROT' or ActivityCode = 'SLID') as

n-riesco commented 6 years ago

Does it happen from the start?

Does the database have many tables and columns?

miahnelson commented 6 years ago

The primary database I was using has 15 tables, column count ranging from 3 to 34. It does seem to work fine for about 10 to 30 seconds before the lagging text issue begins.

One additional piece of info. I went to check the table column/count and I had left Falcon running. Windows was giving me low memory errors. Task manager reported that Falcon was using 9 of 16gb's of ram.

miahnelson commented 6 years ago

Additional system info Dell 7710 Win 10 x64 16gb ram 512gb ssd boot drive 1tb data drive Primary test database was a local instance of SQL server 2012 x64

I was running behind a corporate firewall. Does Falcon communicate with Plotly cloud during the SQL query phase of the process, and if so could the firewall potentially be the issue?

n-riesco commented 6 years ago

I was running behind a corporate firewall. Does Falcon communicate with Plotly cloud during the SQL query phase of the process, and if so could the firewall potentially be the issue?

Yes, at the moment it does. Falcon used to be known as plotly-database-connector and it can be used to query a database and export the results to Plotly cloud.

Also, when you start Falcon, if you log into Plotly, Falcon will try to generate an SSL certificate using Let's encrypt to be used between Falcon's frontend and its backend.

I'm copying below the relevant questions from Falcon FAQ tab:

        q: '[Advanced] What\'s an SSL certificate (and why do I need one?)',
        a: 'An SSL certificate is used to encrypt the requests between your web browser and this \
            connector. Unencrypted requests are blocked by default in modern web browsers. \
            We generate these certificates for you automatically through Let\'s Encrypt. This \
            certificate takes several minutes to generate.'

        q: '[Advanced] How do you generate certificates for a localhost web server?',
        a: 'This application runs a server locally on localhost: It is not exposed to the network. SSL \
            certificates cannot be issued for localhost servers, so we create a unique, local URL for you \
            and a global DNS entry that points that URL to localhost. We use Let\'s Encrypt \
            to generate certificates for that unique, local URL.'
n-riesco commented 6 years ago

@miahnelson A few more questions:

n-riesco commented 6 years ago

@miahnelson I haven't been able to reproduce this issue in our latest pre-release.

I'm going to assume the latest oauth changes have solved the issue. But, please, feel free to reopen it.

Although we've also made some changes to the code editor, and performance has improved, there is still a lot of space for improvement.