Poker-AI.org
http://poker-ai.org/phpbb/

Is it safe to connect to postgreSQL on VM from host?
http://poker-ai.org/phpbb/viewtopic.php?f=26&t=2665
Page 1 of 1

Author:  HontoNiBaka [ Thu Dec 12, 2013 9:32 am ]
Post subject:  Is it safe to connect to postgreSQL on VM from host?

Will it still be impossible to scan my processes etc. on the host from the VM?

Author:  corintio [ Sat Dec 14, 2013 2:05 am ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

It's possible to know the TCP/IP connections opened from the VM, which would raise a flag. A better solution would be to have postgres running in the host and configuring PT (or whatever you're using) to connect to it using the host's IP

Author:  HontoNiBaka [ Sat Dec 14, 2013 1:22 pm ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

Why is that safer? I don't know a lot about security, what is the difference between both methods?

Author:  maikon [ Sun Dec 15, 2013 12:06 am ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

It is perfectly ok to have your database across the network and connect to it(so DB on host, PT4 or HEM1 on VM). This works for PT and HEM1(not HM2) and is a used function by normal users. On the other hand, an external process connecting to the VM DB might raise some flags. Alternatively, you can probably use several cloud tracker DBs on the market.

Author:  HontoNiBaka [ Sun Dec 15, 2013 7:54 pm ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

Ok, I guess it's really less suspicious. thx

Author:  HontoNiBaka [ Mon Dec 16, 2013 4:04 pm ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

I started working on my SQL queries, but its extremelly slow, one query takes 0.12 seconds and my DB isn't even big yet. Is that normal? Is there anything I can do, besides caching? Would it make sense to just load the whole Db into RAM?

Author:  HontoNiBaka [ Tue Dec 17, 2013 9:36 am ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

Well, I implemented simple caching and simple garbage collection now, it seems to work fine now, but I need to test it in real play. Let me know if anyone is interrested in a small pt4 java tutorial.

Author:  ibot [ Tue Dec 17, 2013 5:47 pm ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

PT4 already has a cache that they use for fast stat retrieval, are you using that? How big is your db?

Author:  HontoNiBaka [ Fri Dec 20, 2013 11:45 am ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

No, I am using my own cache, where I save the ResultSets. I looked into the PT4 cache, but it doesn't have the elementary stats, this would mean, that I can not create custom columns, or will the appear in the cache, if I define them in PT4?

Author:  HontoNiBaka [ Tue May 27, 2014 7:46 am ]
Post subject:  Re: Is it safe to connect to postgreSQL on VM from host?

I have not been very active in the past weeks, but I started my bot project again and I recognized my mistake.

I was pretty much a complete noob, when it came to SQL. The bottleneck was (like it is often) the data transfer. Most stats are just a ratio of sums of things, like SUM(VPIP Flag) / SUM(Hands) but I have been transferig lanrge data sets into my ResultSet object and I was later looping through it in Java.

Now I use SUM() in my SQL statements and only transfer a single integer to Java. It brough the computation of some stats from 340ms down to 1ms, should be fast enough now.
You should do most of your computation in SQL if you have similar problems and filter the data as much as possible with WHERE statemets.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/