oltpbench icon indicating copy to clipboard operation
oltpbench copied to clipboard

Running LinkBench against PostgreSQL

Open swkim86 opened this issue 8 years ago • 26 comments

Hi.

I'm trying to run LinkBench against PostgreSQL.

But, the sample configuration file is provided only for MySQL.

Could anyone explain how to run LinkBench especially for PostgreSQL?

Thanks in advance.

swkim86 avatar Jan 06 '16 08:01 swkim86

You can change the configuration to make it use Postgres. It should be pretty easy to figure out.

On Wednesday, January 06, 2016 12:07:17 AM swkim86 wrote:

Hi

I'm trying to run LinkBench against PostgreSQL

But, the sample configuration file is provided only for MySQL

Could anyone explain how to run LinkBench especially for PostgreSQL?

Thanks in advance


Reply to this email directly or view it on GitHub: https://github.com/oltpbenchmark/oltpbench/issues/112

Andy Pavlo [email protected]

apavlo avatar Jan 06 '16 13:01 apavlo

Someone needs to write a Postgres version of LinkStoreMySQL. I know the use of INSERT ... ON DUPLICATE KEY UPDATE is specific to MySQL.

https://github.com/mdcallag/linkbench/blob/master/src/main/java/com/facebook/LinkBench/LinkStoreMysql.java

mdcallag avatar Jan 07 '16 16:01 mdcallag

I think that Mark is right. There are some MySQL specific queries in LInkBench. I tried to run LinkBench against other DBMS such as Oracle. Actually, I already have one for Oracle, but it became pretty different from what it was. So I'm not sure whether it is correct and it is reflected LinkBench's original behavior. Nonetheless, if you want it, I will make a pull request.

woonhak avatar Jan 07 '16 16:01 woonhak

If you make a pull request to linkbench, my fork might be the best repo as the upstream repo has been archived for lack of activity: https://github.com/mdcallag/linkbench https://github.com/facebookarchive/linkbench

mdcallag avatar Jan 07 '16 16:01 mdcallag

Dear Mark, I will make a pull request for your repo, after revised it for PostgreSQL.

woonhak avatar Jan 07 '16 16:01 woonhak

Now that 9.5 has UPSERT, might be interesting to finish this port.

jberkus avatar Jan 07 '16 19:01 jberkus

The suggested schema works well for InnoDB. I am curious how it works for other DBMS. I am mostly talking about the covering secondary index on the Link table. That exists to make a frequent query index only. A few years back PG was enhanced to make such queries index only, but I don't know enough about PG and the visibility map to have a good opinion.

We also run the benchmark with InnoDB in repeatable read mode. Repeatable read in PG is not the same as in InnoDB. There might be more conflict errors detected with PG. Some details are at https://github.com/MariaDB/webscalesql-5.6/wiki/Cursor-Isolation

mdcallag avatar Jan 07 '16 20:01 mdcallag

Why is it run in repeatable read?

jberkus avatar Jan 07 '16 22:01 jberkus

Probably because RR is the default for InnoDB. I have never gone through the work to figure out what might happen with InnoDB-style RC, PG-style RR/RC/SSI or Oracle-style RC.

At work, but not in linkbench, there have been a few apps that needed gap-locking as done by InnoDB RR.

mdcallag avatar Jan 07 '16 23:01 mdcallag

Yeah, with Postgres you have choices of isolation which are either higher or lower than MySQL RR. Either way, it's not directly comparable. If you need predicate locking in Postgres, most of the time you use Serializable.

jberkus avatar Jan 08 '16 17:01 jberkus

Slightly off topic, but we are implementing a MySQL storage engine for RocksDB which will do RR and RC. RR provides PG-style semantics rather than InnoDB.

On Fri, Jan 8, 2016 at 9:35 AM, Josh Berkus [email protected] wrote:

Yeah, with Postgres you have choices of isolation which are either higher or lower than MySQL RR. Either way, it's not directly comparable. If you need predicate locking in Postgres, most of the time you use Serializable.

— Reply to this email directly or view it on GitHub https://github.com/oltpbenchmark/oltpbench/issues/112#issuecomment-170067901 .

Mark Callaghan [email protected]

mdcallag avatar Jan 08 '16 18:01 mdcallag

Postgres Serializable semantics, or our RR ones?

jberkus avatar Jan 08 '16 18:01 jberkus

RR

On Fri, Jan 8, 2016 at 10:46 AM, Josh Berkus [email protected] wrote:

Postgres Serializable semantics, or our RR ones?

— Reply to this email directly or view it on GitHub https://github.com/oltpbenchmark/oltpbench/issues/112#issuecomment-170087824 .

Mark Callaghan [email protected]

mdcallag avatar Jan 08 '16 19:01 mdcallag

FWIW, I don't recommend running RR on Postgres. We support it because standards, but really you want either RC or Serializable.

jberkus avatar Jan 08 '16 19:01 jberkus

@mdcallag I've done implement new LinkStorePgsql.java for PostgreSQL on LInkBench. I will make pull request after running short term test. @swkim86 Linkbench for PostgreSQL currently supports only postgresql 9.5 because of UPSERT issue. If you want to run for other versions < 9.5, then you should change queries using plpgsql script for UPSERT.

woonhak avatar Jan 28 '16 15:01 woonhak

I've done also short term test. With running 1GB database with 8 requestor for 10 minutes. It was fine for me. No errors were reported.

woonhak avatar Jan 28 '16 15:01 woonhak

Thanks Woon-Hak! I'll test the modified version on my platform. I appreciate all the comments. Thank you all.

swkim86 avatar Feb 03 '16 05:02 swkim86

@wookhak, thanks for doing that!

jberkus avatar Feb 05 '16 08:02 jberkus

@jberkus You're welcome.

woonhak avatar Feb 05 '16 15:02 woonhak

I am not able to run linkbench benchmark using oltpbench for mysql. getting following errors: Exception in thread "main" java.lang.NullPointerException at com.oltpbenchmark.util.SQLUtil.getInsertSQL(SQLUtil.java:384) at com.oltpbenchmark.util.SQLUtil.getInsertSQL(SQLUtil.java:366) at com.oltpbenchmark.util.SQLUtil.getInsertSQL(SQLUtil.java:343) at com.oltpbenchmark.benchmarks.linkbench.LinkBenchLoader.load(LinkBenchLoader.java:54) at com.oltpbenchmark.api.BenchmarkModule.loadDatabase(BenchmarkModule.java:305) at com.oltpbenchmark.api.BenchmarkModule.loadDatabase(BenchmarkModule.java:269) at com.oltpbenchmark.DBWorkload.runLoader(DBWorkload.java:783) at com.oltpbenchmark.DBWorkload.main(DBWorkload.java:539) command used to load database: ./oltpbenchmark -b linkbench -c config/sample_linkbench_config.xml --create=true --load=true

Can you please tell me the correct way to run this benchmark.

chandrabvv avatar Mar 10 '17 13:03 chandrabvv

@chandrabvv Please post a separate issue.

apavlo avatar Mar 10 '17 13:03 apavlo

UPSERT for reference https://github.com/mdcallag/linkbench/blob/master/src/main/java/com/facebook/LinkBench/LinkStorePgsql.java#L373..L383

So it just looks like a dialects-export needs to happen.

grooverdan avatar Mar 22 '17 12:03 grooverdan

With a few commits in #140 I've got Postgres to the same state as MySQL - (which is failing like what @chandrabvv mentioned earlier)

https://travis-ci.org/grooverdan/oltpbench/builds/213805602 - oraclejdk8 maps to MySQL-5.6.33 and openjdk8 maps to Postgres-9.6.1 (for travis ease of implementation more than any real logical reason).

Thanks @mdcallag and @jberkus for the discussion here.

grooverdan avatar Mar 23 '17 02:03 grooverdan

If you are still pulling changes for Linkbench activity has moved to https://github.com/mdcallag/linkbench because the upstream version was archived at https://github.com/facebookarchive/linkbench

On Wed, Mar 22, 2017 at 7:06 PM, Daniel Black [email protected] wrote:

With a few commits in #140 https://github.com/oltpbenchmark/oltpbench/pull/140 I've got Postgres to the same state as MySQL - (which is failing like what @chandrabvv https://github.com/chandrabvv mentioned earlier)

https://travis-ci.org/grooverdan/oltpbench/builds/213805602 - oraclejdk8 maps to MySQL-5.6.33 and openjdk8 maps to Postgres-9.6.1 (for travis ease of implementation more than any real logical reason).

Thanks @mdcallag https://github.com/mdcallag and @jberkus https://github.com/jberkus for the discussion here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oltpbenchmark/oltpbench/issues/112#issuecomment-288595961, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkKTeQQjx__v3fiAUErphp12Pr-PFIoks5rodOigaJpZM4G_aum .

-- Mark Callaghan [email protected]

mdcallag avatar Mar 25 '17 16:03 mdcallag

@mdcallag, yep. noticed. thanks.

grooverdan avatar Mar 26 '17 21:03 grooverdan

@chandrabvv - your error is reported here with a work around #47

grooverdan avatar Mar 28 '17 23:03 grooverdan