Amazon EC2 spot instance requests seem to be throttled - php

I can't get more than 2 spot instances into to be fulfilled at any given time.
Requests are for m3.large Windows instances.
Request bids are above the current price for all zones in us-east-1
Account Spot Request limitation is currently 40.
Account limit for m3.large instances is 20.
If I manually request 3 I receive a status of capacity-oversubscribed for the third, always. If I cancel one of the two that are fulfilled, the third is fulfilled.
If I request 3 through the API, 2 are fulfilled and I get a status of az-group-constraint. If I cancel one of the successful requests, the third is fulfilled.
This seems like I'm hitting some kind of limitation that I'm not aware of or some kind of throttling.
This is request array I'm sending over:
Array
(
[DryRun] => false
[SpotPrice] => 0.13
[InstanceCount] => 1
[Type] => one-time
[ValidUntil] => 1418087849 // about an hour from the original request
[LaunchGroup] => d4768b0ba115414a70d2fd8ffe3e6d67 // unique to each request
[AvailabilityZoneGroup] => us-east-1
[LaunchSpecification] => Array
(
[InstanceType] => m3.large
[ImageId] => ami-34222d5c
[KeyName] => thu
[Monitoring] => Array
(
[Enabled] => false
)
[SecurityGroupIds] => Array
(
[0] => sg-31273f54
)
)

Related

PHP Custom Session Handler not working on some domains

We have several quality domains with the identical code base. We are converting from using the native PHP session handler to a custom session handler writing the session data to MySQL. On certain domains the session handling is broken because the session data written to the database is corrupted.
At first we thought it might have something to do with different PHP levels on the different domains. However, we have ruled this out as one domain where it is not working has the same PHP level as a domain where it is working.
This question seems similar to the one at
Custom Session Handler not working on PHP5.6 but does on PHP7. However, in our case the issue is not resolved by adding session_write_close().
Here is some debugging output from the two different instances that clearly shows what is happening. In each case, first a print_r of $_SESSION is shown, followed by the contents of the session data as it will be written to the database:
On first domain designated as "local":
Before write--session data via print_r:
Array ( [debug] => Array ( [0] => Session ID e2104hafmvtur2rsof78m918gs ) [scr_width] => 2560 [recent_page_view_history] => Array ( [0] => / [1] => / [2] => / [3] => / [4] => / [5] => / ) [my_user_label_full] => Independent Sales Rep [my_user_label_short] => Rep [opp_user_type_id] => 2 [opp_user_label_full] => Principal [opp_user_label_long] => New Line [opp_user_label_long_seo] => Independent Sales Companies & New Line [opp_user_label_short] => Principal [user_value_stmt] => Industry Expertise [opp_user_value_stmt] => Sales Opportunity [with_or_as] => as an Independent Sales Rep. This guide for companies that hire reps will help you understand how to be a better rep. [is_help_open] => 1 [referrer] => / [IE_warning_given] => 1 [link_mode] => 0 [isTouchScreen] => 0 [dynamicInputWording] => point your cursor at [dynamicInputWordingCapitalized] => Point your cursor at [devicePixelRatio] => 2 )
Before write--data passed into custom session handler write():
debug|a:1:{i:0;s:37:"Session ID e2104hafmvtur2rsof78m918gs";}scr_width|s:4:"2560";recent_page_view_history|a:6:{i:0;s:1:"/";i:1;s:1:"/";i:2;s:1:"/";i:3;s:1:"/";i:4;s:1:"/";i:5;s:1:"/";}my_user_label_full|s:21:"Independent Sales Rep";my_user_label_short|s:3:"Rep";opp_user_type_id|i:2;opp_user_label_full|s:9:"Principal";opp_user_label_long|s:8:"New Line";opp_user_label_long_seo|s:42:"Independent Sales Companies & New Line";opp_user_label_short|s:9:"Principal";user_value_stmt|s:18:"Industry Expertise";opp_user_value_stmt|s:17:"Sales Opportunity";with_or_as|s:117:"as an Independent Sales Rep. This guide for companies that hire reps will help you understand how to be a better rep.";is_help_open|b:1;referrer|s:1:"/";IE_warning_given|b:1;link_mode|i:0;isTouchScreen|s:1:"0";dynamicInputWording|s:20:"point your cursor at";dynamicInputWordingCapitalized|s:20:"Point your cursor at";devicePixelRatio|s:1:"2";
The above looks as expected and the website works normally.
On second domain designated as "dev":
Before write--session data via print_r:
Array ( [debug] => Array ( [0] => Session ID v301fcrls9ijktjtlc7n4gd3n5 ) [scr_width] => 2560 [recent_page_view_history] => Array ( [0] => /landing-page.php [1] => /landing-page.php [2] => /landing-page.php [3] => /landing-page.php [4] => /landing-page.php [5] => /landing-page.php ) [my_user_label_full] => Principal [my_user_label_short] => Principal [opp_user_type_id] => 1 [opp_user_label_full] => Independent Sales Rep [opp_user_label_long] => Sales Rep [opp_user_label_long_seo] => Independent Sales Rep [opp_user_label_short] => Rep [user_value_stmt] => Sales Opportunity [opp_user_value_stmt] => Industry Expertise [with_or_as] => with Independent Sales Reps. [is_help_open] => 1 [referrer] => /landing-page.php [IE_warning_given] => 1 [link_mode] => 0 [isTouchScreen] => 0 [dynamicInputWording] => point your cursor at [dynamicInputWordingCapitalized] => Point your cursor at [devicePixelRatio] => 2 [site_user_type] => 2 [lp_source] => register-external )
Before write--data passed into custom session handler write():
pQkKjjiuhsxKkLD5bG1pcvfRiU073NotPwuYW3TrIAEwiKACrZ1s6dbIQmOeo7430UQAYgu_GENi_KhZx4vSUdaV4iXmSOVxNZgoNC_7-xDzOMDdRo7zp3sk-_aEv3XyenNiNtcy5GkE7UH1O1qKG-WBXel7bDNJ6hVUaadz9DoBwzhHFid5O5TOBT9gccwzAab2DWN-sa4vjwSDwaQ03rxquQT07iv4T_BQPvB2_pLYB_fz7GSI470o-bePEb4N209gd3oUA4xlg0Hw4pCssCN6FO6vtamNzaTqXDpS-f9nGhxpALp1eUZ1ts9nzbAZQ_llj0XbOW3FtnmnargZjbigJBWvL5XmD_bg5yIZwCHxJ4w8CWrKjasjfuInLMmzi02ViEtjmxtCZ5kLMETjE42MOSRuqrK7wr6zZFEha3gK2wfzQvrIwbr3ZEQTOpzBinYggiECiLAkpH4qy6XTjgnc-RT4_r4L7_LD2rBtXKjm3gNJgjZeLjeUMZubXBcLVGiW1ELuLgq0zHmU6ppIAMhk1rkThOMq3qgyQ0rsJGauTPDrImWzbbbnBgbooYywscjZjf-KNoRyCEaZRFga1zEeQWheEYFO7miVXFi-BSZZYJfXFHuto-kcfV9yZHInlz9p1Lcgd0YpbVUeIwZb2MUPhhzASDUnu4uuy_iVUn6WsyuEciQVYhEDcLBYJ6zHlSTs46vOWJdjE19LR8HQQL5jKJZBJpeC_jqgTNDWsVC5B1hZKpFswDZnOrUgEKOS9rHfusYOw0Ydczhr67TBTzCVUZvJVbm77LgBuY-JuLCv2Yv6mMCltXohtxMhb5t6PMXTnQTsinJD_SdY0YQZbAo26iPlO3u690IJd2tncPFZavwcflKodm_KW0LLtUR4CX4MZ0tmqY0qB1lkW8qgri6aZKAvgurr9BZhZcNqcsnAb6Po7zLdZOtwM3KF51LBzbcxGiDG6yWUy_9nw9p_y9GadXbfhfFbmR5jTQsaJLxR2-Y_2TiMxhgkWu7G2Buv6IZqUD-dCvU9vXQTnyUhlVijsO1pP02IxqtyO4D8cGp4k8l7IxeuqxsbX2oj7IdhiYIwG5t5IfEKTOQiimjPV0jSsBhwIftD5U-ofwpEQjcd7MLrzm7iX3eZuFnVvvNsMg_TCOScvs4b0DhV46KdDLfdD4WMoVhI6QnFH4s7jiqI9TYQNLRqSZNqO1cdFGHSyLcT1qGpDpZn0-ljpV_nzrYDXe6d2fsejqBZs_aWAZQFFJ7qMwUzVX53dzLgTf3ziAzPwPayQl8NBd8VptIKiVLZfN1v0tofRPuNXXVUd2s.
As you can see, rather than the special serialized version of the data, it becomes obfuscated in some way. And session handling is broken.
On a domain designated as "qa", the output is identical to "local". Please note that "local" has php 7.1, while both "dev" and "qa" have php 5.6. The php.ini files for all three domains have identical settings for session.* variables.
Question: what is the cause of the obfuscation of session data?
We found the solution. It was that Suhosin was enabled on some domains but not on others. Suhosin automatically encrypts the session data.
We will be losing Suhosin as we move forward as it appears to not be an integral part of PHP 7+. Either is is not available, or does not compile properly.

Payflow Pro Reference Transactin is not working for test account

I want to integrate Payflow pro reference transaction (Credit card) in my cart. I am using payflow manager test account and enabled reference transactions to "Yes" in manage security tab.
I could successfully transfer test payment first time, this is my response - Array ( [RESULT] => 0 [PNREF] => A70A7EB1773A [RESPMSG] => Approved [AUTHCODE] => 928PNI [AVSADDR] => X [AVSZIP] => X [CVV2MATCH] => Y [HOSTCODE] => A [PROCAVS] => U [PROCCVV2] => M [VISACARDLEVEL] => 12 [IAVS] => X [PREFPSMSG] => No Rules Triggered [POSTFPSMSG] => No Rules Triggered )
But when I try to do reference transactions, i am getting below response - Array ( [RESULT] => 23 [PNREF] => A1008A6A9700 [RESPMSG] => Invalid account number ), I am using same PNREF num as ORIGID and successfully completed payment at initial time. Then why it is showing "Invalid account number" ?
Below arguments I have used for reference transaction - $nvpstr = "TRXTYPE=S&TENDER=C&PWD=an****&PARTNER=PayPal&VENDOR=an****&USER=an****&ORIGID=A70A7EB1773A&AMT=2.00";
Do we need to call paypal team to enable reference transaction for TEST ACCOUNT also ? Please help me to resolve the issue
It seems like you are not passing the "TRXTYPE=S" along with the other parameters. Even though in your above request you have mentioned "TRXTYPE=S" but still I believe somehow it is not being sent to the PayPal .

YouTube API v3 stopped returning status.publishAt

When I request the video resource (using the official PHP library) example:
$youtube->videos->listVideos($ytVideoID, "snippet, contentDetails, status");
the API stopped returning status.publishAt couple months ago.
I am getting only this now:
[status] => Array
(
[uploadStatus] => processed
[privacyStatus] => private
[license] => youtube
[embeddable] => 1
[publicStatsViewable] => 1
)
I need the response to look something like this:
[status] => Array
(
[publishAt] => '2015-07-15T22:45:00'
[uploadStatus] => processed
[privacyStatus] => private
[license] => youtube
[embeddable] => 1
[publicStatsViewable] => 1
)
I did not change anything in my code, the API just stopped returning the publishAt parameter one day. I did not managed to find any reference to any change in the API.
All the videos I am trying to load, have status: scheduled (private), so the publishAt parameter should be there.
Reported this internally. https://code.google.com/p/gdata-issues/issues/detail?id=7447
I will update with solution.

Google APIs Client Library for PHP - countryBlocked exception

I've created a web application which runs with the 'Google APIs Client Library'.
This worked perfectly for me for the last two years.
But since yesterday I am facing a huge problem.
If I want to access the analytics api the system returns:
Google_Service_Exception Object
(
[errors:protected] => Array
(
[0] => Array
(
[domain] => global
[reason] => countryBlocked
[message] => This service is not available from your region
)
)
[retryMap:Google_Service_Exception:private] => Array
(
[500] => -1
[503] => -1
[rateLimitExceeded] => -1
[userRateLimitExceeded] => -1
)
[message:protected] => Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles: (403) This service is not available from your region
)
I've checked the logs and made 50 requests the last 30 days so spamming could not be the reason for the block.
When I run it from a different Server it runs just fine.
Can anyone explain why this is happening and how I can bypass it?

Fetch Report using GoodData API

I have created a report on my GoodData UI. Now I want to fetch this report using the API. I spent hours digging the API docs but I am unable to find a simple way to do so.
If I try gdc/execute/raw/, it returns
[error] => Array
(
[parameters] => Array
(
[0] => execute
)
[requestId] => 53fPgKcFdkjf8PZ5:4n6x9lp9vk3ydbvs
[component] => GDC
[errorClass] => GDC::Exception::NotFound
[message] => resource %s not found
)
If I try gdc/xtab2/executor3 it returns
[error] => Array
(
[parameters] => Array
(
[0] => report_req
[1] => STRUCTURE INVALID - name of structure:'ReportReq'(tag:report_req), /report_req/ExecutionObject: Object does not match any alternative. Alternatives tried : [STRUCTURE INVALID - name of structure:'ReportReq' ...]
)
[requestId] => a0yRpNUpCPRsbPS0:6nagmwaw61h5g2bn
[component] => Apache::REST
[errorClass] => GDC::Exception::User
[message] => Checking '%s', result %s
)
Your requests got 404 and 400 statuses respectively.
When you tried to use 'gdc/execute/raw/' the call that reached our side was: "request="POST /gdc/execute/raw/ HTTP/1.1"", instead of that it should look like "POST /gdc/app/projects/{your_project_id}/execute/raw/ HTTP/1.1", that's the reason your are getting a 'NotFound' error. Regarding 'gdc/xtab2/executor3' there's apparently something wrong within the body of the call.
Please post your calls here, their bodies and how exactly you are making them, or open a support ticket with those details at https://support.gooddata.com/home so that we can investigate further.
Ultimately I followed this code piece https://gist.github.com/gnilrets/b9d2ce9890d8aaa07042
Much better than reading the whole GoodData API documentation.

Categories