0

With OpenDJ3.0, about 3 millions entries are saved. the entries I saved actually is tokens which has ttl (aka expiry time).

What I'm doing is try to schedule a cron job to periodically search out those expired tokens, and delete them.

I'm using OpenDJ sdk SimplePagedResultsControl to perform a paged search, pageSize=1000, timelimit=60 seconds, search filter is (token-ttl<=20170724234636.576Z)

The search user I'm using is the default "cn=Directory Manager", with default resource limit settings. BTW, the entry-limit for token-ttl index I set is 20000

But in case of two many tokens matched the filter, the search took forever to return.

I tried the ldapsearch utility, the same result.

Any suggestions ?

Thanks

Feng Xi
  • 1,005
  • 2
  • 11
  • 30

1 Answers1

0

It looks like the search is unindexed and tries to scan the whole database in search of matching entries. Normally your search should hit some limit and be stopped forcefully (like the cursor read limit: once 100000 records have been read in the db).

You may try to add an ordering index on token-ttl attribute? Search filters hitting this attribute will be faster, however any operation updating this attribute will be a bit slower. That is the trade-off with indexes.

JnRouvignac
  • 807
  • 5
  • 19
  • Thanks JnRouvignc. I'm pretty sure that I added the index on token-ttl. – Feng Xi Jul 27 '17 at 08:15
  • How precise is the index? Is it indexing with precision to the second or precision to the millisecond? Are you sure it is an ordering index? – JnRouvignac Jul 28 '17 at 08:04