Re: Got thread waiting in java when search

2014-12-04 Thread nodexy
Fixed this .

The key point is NEVER invoke cross-server or cross-process service in a 
for loop . This is not a question to elasticsearch but common programming 
sutff.
Sorry for disturbation. Thanks.


On Tuesday, December 2, 2014 5:55:21 PM UTC+8, nodexy wrote:
>
> Hi,
>
> I got this issue when build a basic  search service by ElasticSearch in 
> Java as belown:
>
> SearchResponse resp = client
> .prepareSearch(ElasticSearchManager.INDEX_NAME)
> .setTypes(ElasticSearchManager.INDEX_TYPE)
> // way 1
> // .setQuery(QueryBuilders.termQuery("pkgName",
> // pkgName.toLowerCase()))
> // way 2
> .setQuery(QueryBuilders.matchAllQuery())
> .setPostFilter(
> FilterBuilders.termFilter("pkgName",
> pkgName.toLowerCase())).execute().
> actionGet();
>
>
>  And this method is invoked in a for loop on a list with 20 elements .
>
> When we run this service in Tomcat container under 500 concurrent thread, 
> so many threads are waiting  like this(TPS is about 1500):
> 名称: catalina-exec-15
> 状态: org.elasticsearch.common.util.concurrent.BaseFuture$Sync@23772759上的
> WAITING
> 总阻止数: 1,136, 总等待数: 166,545
>
> 堆栈跟踪: 
> sun.misc.Unsafe.park(Native Method)
> java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
> java.util.concurrent.locks.AbstractQueuedSynchronizer.
> parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
> java.util.concurrent.locks.AbstractQueuedSynchronizer.
> doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
> java.util.concurrent.locks.AbstractQueuedSynchronizer.
> acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
> org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get(BaseFuture.
> java:274)
> org.elasticsearch.common.util.concurrent.BaseFuture.get(BaseFuture.java:
> 113)
> org.elasticsearch.action.support.AdapterActionFuture.actionGet(
> AdapterActionFuture.java:45)
> com.xxx.service.elastic.ElasticSearchService.getByPkgName(
> ElasticSearchService.java:324)
> ... ...
>
> (sorry for the Chinese system language )
>
> monitor info from jvisualvm:
>
>
> Notes: 
> 1. All ElasticsSearch is default .
> 2. Another service without for loop is really good , 1 concurrent with 
> 5000+ tps .
>
> So is for loop the real reason ? How should I update this ?  
> Really thanks for your attention .
>  
> nodexy
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/bf1ec0db-434a-42a9-a549-934ca7ba047c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dealing with spam in this forum

2014-12-02 Thread nodexy
The first post should be approved .


On Wednesday, July 2, 2014 2:36:44 AM UTC+8, Clinton Gormley wrote:
>
> Hi all
>
> Recently we've had a few spam emails that have made it through Google's 
> filters, and there have been a calls for us to change to a 
> moderate-first-post policy. I am reluctant to adopt this policy for the 
> following reasons:
>
> We get about 30 new users every day from all over the world, many of whom 
> are early in their learning phase and are quite stuck - they need help as 
> soon as possible. Fortunately this list is very active and helpful. In 
> contrast, we've only ever banned 34 users from the list for spamming.  So 
> making new users wait for timezones to swing their way feels like a heavy 
> handed solution to a small problem. Yes, spammers are annoying but they are 
> a small minority on this list.
>
> Instead, we have asked 10 of our long standing members to help us with 
> banning spammers.  This way we have Spam Guardians active around the globe, 
> who only need to do something if a spammer raises their ugly head above the 
> parapet. One or two spam emails may get through, but hopefully somebody 
> will leap into action and stop their activity before it becomes too 
> tiresome.
>
> This isn't an exclusive list. If you would like to be on it, feel free to 
> email me.  Note: I expect you to be a long standing and currently active 
> member of this list to be included. 
>
> If this solution doesn't solve the problem, then we can reconsider 
> moderate-first-post, but we've managed to go 5 years without requiring it, 
> and I'd prefer to keep things as easy as possible for new users.
>
> Clint
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/10ea16ea-3e97-4920-8061-8eb5f582394e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.